Skip to content

Commit 2312c3e

Browse files
authored
First steps in autocomplete (microsoft#5601)
* Testing codemirror's autocomplete * Remember monacoEditor pieces * New idea for using the language client * Farther along the completion provider idea. * New idea mapped together * Closer. no more errors * Working completion * Sorting * Reverse sort kind * Getting monaco to show context menu and completion * Fix margin width * Add comment about language service * Start of completion provider * Update to use monaco types instead * New IHistoryListener idea * Fix document position * Theme support * Colorization mostly working * Move editor to standalone panel at the bottom * Fix startup of the language server * Input history working again * Fix problem with convertToOffset * Write own react monaco editor to handle update problems * Add unit test for the completion provider * Fix editing for intellisense * Adding hover support * Fix hover to work even when expanding collapsing cells. * Add suggest.css and base64 encoding of icons * Fix completion item kind * Undo less work. Not necessary * Put watermark back * Fix hover css * Fix scrolling after resizing * Add actual table to test state. * Split between jedi and language server * Fix jedi for completion * Fix remove cell and remove all to work * Fix hover to work correctly with big hack * Don't ever remove items from the document as the cells that ran are still there Only remove on restart * Make package createable * Add babel transpile for monaco-editor so tests can run * Input test in history functional working * Get test to not hang on exit * Get all history functional tests to pass * Get tests somewhat working for intellisense * Actual working intellisense test * Fix linter warnings * Fix hover mtk1 css color * Add news entry * Remove react-codemirror * Fix hygiene * Add variable to check remote * Fix default rules to support comment/string beginnings * Fix unnecessary isNull check * Make sure to cleanup after waiting for the suggestion to show up * Fix out of memory error. * Separate out the babel steps as not required for single workspace * Fix color test * Review feedback * Update incorrect block comment
1 parent f1deef6 commit 2312c3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+11347
-860
lines changed

ThirdPartyNotices-Repository.txt

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Microsoft Python extension for Visual Studio Code incorporates third party mater
1414
11. pythonVSCode (https://github.com/DonJayamanne/pythonVSCode)
1515
12. Sphinx (http://sphinx-doc.org/)
1616
13. nteract (https://github.com/nteract/nteract)
17+
14. less-plugin-inline-urls (https://github.com/less/less-plugin-inline-urls/)
1718

1819

1920
%%
@@ -753,3 +754,210 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
753754

754755
=========================================
755756
END OF nteract NOTICES, INFORMATION, AND LICENSE
757+
758+
%% less-plugin-inline-urls NOTICES, INFORMATION, AND LICENSE BEGIN HERE
759+
=========================================
760+
Apache License
761+
Version 2.0, January 2004
762+
http://www.apache.org/licenses/
763+
764+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
765+
766+
1. Definitions.
767+
768+
"License" shall mean the terms and conditions for use, reproduction,
769+
and distribution as defined by Sections 1 through 9 of this document.
770+
771+
"Licensor" shall mean the copyright owner or entity authorized by
772+
the copyright owner that is granting the License.
773+
774+
"Legal Entity" shall mean the union of the acting entity and all
775+
other entities that control, are controlled by, or are under common
776+
control with that entity. For the purposes of this definition,
777+
"control" means (i) the power, direct or indirect, to cause the
778+
direction or management of such entity, whether by contract or
779+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
780+
outstanding shares, or (iii) beneficial ownership of such entity.
781+
782+
"You" (or "Your") shall mean an individual or Legal Entity
783+
exercising permissions granted by this License.
784+
785+
"Source" form shall mean the preferred form for making modifications,
786+
including but not limited to software source code, documentation
787+
source, and configuration files.
788+
789+
"Object" form shall mean any form resulting from mechanical
790+
transformation or translation of a Source form, including but
791+
not limited to compiled object code, generated documentation,
792+
and conversions to other media types.
793+
794+
"Work" shall mean the work of authorship, whether in Source or
795+
Object form, made available under the License, as indicated by a
796+
copyright notice that is included in or attached to the work
797+
(an example is provided in the Appendix below).
798+
799+
"Derivative Works" shall mean any work, whether in Source or Object
800+
form, that is based on (or derived from) the Work and for which the
801+
editorial revisions, annotations, elaborations, or other modifications
802+
represent, as a whole, an original work of authorship. For the purposes
803+
of this License, Derivative Works shall not include works that remain
804+
separable from, or merely link (or bind by name) to the interfaces of,
805+
the Work and Derivative Works thereof.
806+
807+
"Contribution" shall mean any work of authorship, including
808+
the original version of the Work and any modifications or additions
809+
to that Work or Derivative Works thereof, that is intentionally
810+
submitted to Licensor for inclusion in the Work by the copyright owner
811+
or by an individual or Legal Entity authorized to submit on behalf of
812+
the copyright owner. For the purposes of this definition, "submitted"
813+
means any form of electronic, verbal, or written communication sent
814+
to the Licensor or its representatives, including but not limited to
815+
communication on electronic mailing lists, source code control systems,
816+
and issue tracking systems that are managed by, or on behalf of, the
817+
Licensor for the purpose of discussing and improving the Work, but
818+
excluding communication that is conspicuously marked or otherwise
819+
designated in writing by the copyright owner as "Not a Contribution."
820+
821+
"Contributor" shall mean Licensor and any individual or Legal Entity
822+
on behalf of whom a Contribution has been received by Licensor and
823+
subsequently incorporated within the Work.
824+
825+
2. Grant of Copyright License. Subject to the terms and conditions of
826+
this License, each Contributor hereby grants to You a perpetual,
827+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
828+
copyright license to reproduce, prepare Derivative Works of,
829+
publicly display, publicly perform, sublicense, and distribute the
830+
Work and such Derivative Works in Source or Object form.
831+
832+
3. Grant of Patent License. Subject to the terms and conditions of
833+
this License, each Contributor hereby grants to You a perpetual,
834+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
835+
(except as stated in this section) patent license to make, have made,
836+
use, offer to sell, sell, import, and otherwise transfer the Work,
837+
where such license applies only to those patent claims licensable
838+
by such Contributor that are necessarily infringed by their
839+
Contribution(s) alone or by combination of their Contribution(s)
840+
with the Work to which such Contribution(s) was submitted. If You
841+
institute patent litigation against any entity (including a
842+
cross-claim or counterclaim in a lawsuit) alleging that the Work
843+
or a Contribution incorporated within the Work constitutes direct
844+
or contributory patent infringement, then any patent licenses
845+
granted to You under this License for that Work shall terminate
846+
as of the date such litigation is filed.
847+
848+
4. Redistribution. You may reproduce and distribute copies of the
849+
Work or Derivative Works thereof in any medium, with or without
850+
modifications, and in Source or Object form, provided that You
851+
meet the following conditions:
852+
853+
(a) You must give any other recipients of the Work or
854+
Derivative Works a copy of this License; and
855+
856+
(b) You must cause any modified files to carry prominent notices
857+
stating that You changed the files; and
858+
859+
(c) You must retain, in the Source form of any Derivative Works
860+
that You distribute, all copyright, patent, trademark, and
861+
attribution notices from the Source form of the Work,
862+
excluding those notices that do not pertain to any part of
863+
the Derivative Works; and
864+
865+
(d) If the Work includes a "NOTICE" text file as part of its
866+
distribution, then any Derivative Works that You distribute must
867+
include a readable copy of the attribution notices contained
868+
within such NOTICE file, excluding those notices that do not
869+
pertain to any part of the Derivative Works, in at least one
870+
of the following places: within a NOTICE text file distributed
871+
as part of the Derivative Works; within the Source form or
872+
documentation, if provided along with the Derivative Works; or,
873+
within a display generated by the Derivative Works, if and
874+
wherever such third-party notices normally appear. The contents
875+
of the NOTICE file are for informational purposes only and
876+
do not modify the License. You may add Your own attribution
877+
notices within Derivative Works that You distribute, alongside
878+
or as an addendum to the NOTICE text from the Work, provided
879+
that such additional attribution notices cannot be construed
880+
as modifying the License.
881+
882+
You may add Your own copyright statement to Your modifications and
883+
may provide additional or different license terms and conditions
884+
for use, reproduction, or distribution of Your modifications, or
885+
for any such Derivative Works as a whole, provided Your use,
886+
reproduction, and distribution of the Work otherwise complies with
887+
the conditions stated in this License.
888+
889+
5. Submission of Contributions. Unless You explicitly state otherwise,
890+
any Contribution intentionally submitted for inclusion in the Work
891+
by You to the Licensor shall be under the terms and conditions of
892+
this License, without any additional terms or conditions.
893+
Notwithstanding the above, nothing herein shall supersede or modify
894+
the terms of any separate license agreement you may have executed
895+
with Licensor regarding such Contributions.
896+
897+
6. Trademarks. This License does not grant permission to use the trade
898+
names, trademarks, service marks, or product names of the Licensor,
899+
except as required for reasonable and customary use in describing the
900+
origin of the Work and reproducing the content of the NOTICE file.
901+
902+
7. Disclaimer of Warranty. Unless required by applicable law or
903+
agreed to in writing, Licensor provides the Work (and each
904+
Contributor provides its Contributions) on an "AS IS" BASIS,
905+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
906+
implied, including, without limitation, any warranties or conditions
907+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
908+
PARTICULAR PURPOSE. You are solely responsible for determining the
909+
appropriateness of using or redistributing the Work and assume any
910+
risks associated with Your exercise of permissions under this License.
911+
912+
8. Limitation of Liability. In no event and under no legal theory,
913+
whether in tort (including negligence), contract, or otherwise,
914+
unless required by applicable law (such as deliberate and grossly
915+
negligent acts) or agreed to in writing, shall any Contributor be
916+
liable to You for damages, including any direct, indirect, special,
917+
incidental, or consequential damages of any character arising as a
918+
result of this License or out of the use or inability to use the
919+
Work (including but not limited to damages for loss of goodwill,
920+
work stoppage, computer failure or malfunction, or any and all
921+
other commercial damages or losses), even if such Contributor
922+
has been advised of the possibility of such damages.
923+
924+
9. Accepting Warranty or Additional Liability. While redistributing
925+
the Work or Derivative Works thereof, You may choose to offer,
926+
and charge a fee for, acceptance of support, warranty, indemnity,
927+
or other liability obligations and/or rights consistent with this
928+
License. However, in accepting such obligations, You may act only
929+
on Your own behalf and on Your sole responsibility, not on behalf
930+
of any other Contributor, and only if You agree to indemnify,
931+
defend, and hold each Contributor harmless for any liability
932+
incurred by, or claims asserted against, such Contributor by reason
933+
of your accepting any such warranty or additional liability.
934+
935+
END OF TERMS AND CONDITIONS
936+
937+
APPENDIX: How to apply the Apache License to your work.
938+
939+
To apply the Apache License to your work, attach the following
940+
boilerplate notice, with the fields enclosed by brackets "{}"
941+
replaced with your own identifying information. (Don't include
942+
the brackets!) The text should be enclosed in the appropriate
943+
comment syntax for the file format. We also recommend that a
944+
file or class name and description of purpose be included on the
945+
same "printed page" as the copyright notice for easier
946+
identification within third-party archives.
947+
948+
Copyright {yyyy} {name of copyright owner}
949+
950+
Licensed under the Apache License, Version 2.0 (the "License");
951+
you may not use this file except in compliance with the License.
952+
You may obtain a copy of the License at
953+
954+
http://www.apache.org/licenses/LICENSE-2.0
955+
956+
Unless required by applicable law or agreed to in writing, software
957+
distributed under the License is distributed on an "AS IS" BASIS,
958+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
959+
See the License for the specific language governing permissions and
960+
limitations under the License.
961+
962+
=========================================
963+
END OF less-plugin-inline-urls NOTICES, INFORMATION, AND LICENSE
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Most of this was based on https://github.com/less/less-plugin-inline-urls
2+
// License for this was included in the ThirdPartyNotices-Repository.txt
3+
const less = require('less');
4+
5+
class Base64MimeTypeNode {
6+
constructor() {
7+
this.value = "image/svg+xml;base64";
8+
this.type = "Base64MimeTypeNode";
9+
}
10+
11+
eval(context) {
12+
return this;
13+
}
14+
}
15+
16+
class Base64Visitor {
17+
18+
constructor() {
19+
this.visitor = new less.visitors.Visitor(this);
20+
21+
// Set to a preEval visitor to make sure this runs before
22+
// any evals
23+
this.isPreEvalVisitor = true;
24+
25+
// Make sure this is a replacing visitor so we remove the old data.
26+
this.isReplacing = true;
27+
}
28+
29+
run(root) {
30+
return this.visitor.visit(root);
31+
}
32+
33+
visitUrl(URLNode, visitArgs) {
34+
// Return two new nodes in the call. One that has the mime type and other with the node. The data-uri
35+
// evaluator will transform this into a base64 string
36+
return new less.tree.Call("data-uri", [new Base64MimeTypeNode(), URLNode.value], URLNode.index || 0, URLNode.currentFileInfo);
37+
}
38+
39+
}
40+
/*
41+
* This was originally used to perform less on uris and turn them into base64 encoded so they can be loaded into
42+
* a webpack html. There's one caveat though. Less and webpack don't play well together. It runs the less at the root dir.
43+
* This means in order to use this in a less file, you need to qualify the urls as if they come from the root dir.
44+
* Example:
45+
* url("./foo.svg")
46+
* becomes
47+
* url("./src/datascience-ui/history-react/images/foo.svg")
48+
*/
49+
class Base64Plugin {
50+
constructor() {
51+
}
52+
53+
install(less, pluginManager) {
54+
pluginManager.addVisitor(new Base64Visitor());
55+
}
56+
57+
printUsage() {
58+
console.log('Base64 Plugin. Add to your webpack.config.js as a plugin to convert URLs to base64 inline')
59+
}
60+
}
61+
62+
module.exports = Base64Plugin;

build/webpack/webpack.extension.dependencies.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ const config = {
4141
// 'find' the calling extension.
4242
new copyWebpackPlugin([
4343
{ from: './package.json', to: '.' }
44+
]),
45+
// onigasm requires our onigasm.wasm to be in node_modules
46+
new copyWebpackPlugin([
47+
{ from: './node_modules/onigasm/lib/onigasm.wasm', to: './node_modules/onigasm/lib/onigasm.wasm' }
4448
])
4549
],
4650
resolve: {

build/webpack/webpack.extension.dependencies.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ const config: webpack.Configuration = {
4545
// 'find' the calling extension.
4646
new copyWebpackPlugin([
4747
{ from: './package.json', to: '.' }
48+
]),
49+
// onigasm requires our onigasm.wasm to be in node_modules
50+
new copyWebpackPlugin([
51+
{ from: './node_modules/onigasm/lib/onigasm.wasm', to: './node_modules/onigasm/lib/onigasm.wasm' }
4852
])
4953
],
5054
resolve: {

news/1 Enhancements/5342.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Provide basic intellisense using the language server.

0 commit comments

Comments
 (0)