monaco-editor11 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css.worker-C7FogG4G.js +93 -0
- package/dist/assets/editor.worker-iXcRX1Tq.js +26 -0
- package/dist/assets/html.worker-C8VxctEJ.js +470 -0
- package/dist/assets/json.worker-CMC9kgPL.js +58 -0
- package/dist/assets/ts.worker-CtTJ3hNN.js +67731 -0
- package/dist/index.d.ts +0 -6
- package/dist/monaco-editor11.es.js +49 -78
- package/dist/monaco-editor11.umd.js +1 -50
- package/dist/monaco.d.ts +8 -0
- package/dist/workers/common/initialize.js +16 -0
- package/dist/workers/common/workers.js +141 -0
- package/dist/workers/editor/common/abstractSyntaxTokenBackend.js +128 -0
- package/dist/workers/editor/common/abstractText.js +89 -0
- package/dist/workers/editor/common/ast.js +485 -0
- package/dist/workers/editor/common/autoIndent.js +390 -0
- package/dist/workers/editor/common/beforeEditPositionMapper.js +110 -0
- package/dist/workers/editor/common/bracketPairsImpl.js +717 -0
- package/dist/workers/editor/common/bracketPairsTree.js +343 -0
- package/dist/workers/editor/common/brackets.js +108 -0
- package/dist/workers/editor/common/characterClassifier.js +59 -0
- package/dist/workers/editor/common/characterPair.js +40 -0
- package/dist/workers/editor/common/colorizedBracketPairsDecorationProvider.js +97 -0
- package/dist/workers/editor/common/columnRange.js +35 -0
- package/dist/workers/editor/common/combineTextEditInfos.js +124 -0
- package/dist/workers/editor/common/common.js +20 -0
- package/dist/workers/editor/common/computeMovedLines.js +249 -0
- package/dist/workers/editor/common/concat23Trees.js +192 -0
- package/dist/workers/editor/common/contiguousMultilineTokens.js +32 -0
- package/dist/workers/editor/common/contiguousMultilineTokensBuilder.js +23 -0
- package/dist/workers/editor/common/contiguousTokensEditing.js +128 -0
- package/dist/workers/editor/common/contiguousTokensStore.js +207 -0
- package/dist/workers/editor/common/coordinatesConverter.js +51 -0
- package/dist/workers/editor/common/cursor.js +899 -0
- package/dist/workers/editor/common/cursorAtomicMoveOperations.js +145 -0
- package/dist/workers/editor/common/cursorCollection.js +194 -0
- package/dist/workers/editor/common/cursorColumnSelection.js +93 -0
- package/dist/workers/editor/common/cursorColumns.js +112 -0
- package/dist/workers/editor/common/cursorCommon.js +250 -0
- package/dist/workers/editor/common/cursorContext.js +15 -0
- package/dist/workers/editor/common/cursorDeleteOperations.js +231 -0
- package/dist/workers/editor/common/cursorMoveCommands.js +676 -0
- package/dist/workers/editor/common/cursorMoveOperations.js +290 -0
- package/dist/workers/editor/common/cursorTypeEditOperations.js +968 -0
- package/dist/workers/editor/common/cursorTypeOperations.js +173 -0
- package/dist/workers/editor/common/cursorUtils.js +75 -0
- package/dist/workers/editor/common/cursorWordOperations.js +720 -0
- package/dist/workers/editor/common/defaultDocumentColorsComputer.js +138 -0
- package/dist/workers/editor/common/defaultLinesDiffComputer.js +188 -0
- package/dist/workers/editor/common/diffAlgorithm.js +139 -0
- package/dist/workers/editor/common/diffEditor.js +38 -0
- package/dist/workers/editor/common/dynamicProgrammingDiffing.js +101 -0
- package/dist/workers/editor/common/edit.js +183 -0
- package/dist/workers/editor/common/editOperation.js +36 -0
- package/dist/workers/editor/common/editStack.js +363 -0
- package/dist/workers/editor/common/editorAction.js +26 -0
- package/dist/workers/editor/common/editorBaseApi.js +43 -0
- package/dist/workers/editor/common/editorColorRegistry.js +102 -0
- package/dist/workers/editor/common/editorCommon.js +13 -0
- package/dist/workers/editor/common/editorConfigurationSchema.js +338 -0
- package/dist/workers/editor/common/editorContextKeys.js +84 -0
- package/dist/workers/editor/common/editorFeatures.js +17 -0
- package/dist/workers/editor/common/editorOptions.js +3440 -0
- package/dist/workers/editor/common/editorTheme.js +23 -0
- package/dist/workers/editor/common/editorWebWorker.js +299 -0
- package/dist/workers/editor/common/editorWorker.js +9 -0
- package/dist/workers/editor/common/editorWorkerHost.js +15 -0
- package/dist/workers/editor/common/editorZoom.js +26 -0
- package/dist/workers/editor/common/electricCharacter.js +55 -0
- package/dist/workers/editor/common/encodedTokenAttributes.js +79 -0
- package/dist/workers/editor/common/enterAction.js +53 -0
- package/dist/workers/editor/common/eolCounter.js +44 -0
- package/dist/workers/editor/common/findSectionHeaders.js +128 -0
- package/dist/workers/editor/common/fixBrackets.js +67 -0
- package/dist/workers/editor/common/fixedArray.js +70 -0
- package/dist/workers/editor/common/fontInfo.js +172 -0
- package/dist/workers/editor/common/fontInfoFromSettings.js +29 -0
- package/dist/workers/editor/common/getIconClasses.js +106 -0
- package/dist/workers/editor/common/getPositionOffsetTransformerFromTextModel.js +24 -0
- package/dist/workers/editor/common/glyphLanesModel.js +61 -0
- package/dist/workers/editor/common/guidesTextModelPart.js +405 -0
- package/dist/workers/editor/common/heuristicSequenceOptimizations.js +374 -0
- package/dist/workers/editor/common/indentRules.js +63 -0
- package/dist/workers/editor/common/indentation.js +39 -0
- package/dist/workers/editor/common/indentationGuesser.js +178 -0
- package/dist/workers/editor/common/indentationLineProcessor.js +193 -0
- package/dist/workers/editor/common/inlineDecorations.js +26 -0
- package/dist/workers/editor/common/inplaceReplaceSupport.js +87 -0
- package/dist/workers/editor/common/inputMode.js +22 -0
- package/dist/workers/editor/common/intervalTree.js +1002 -0
- package/dist/workers/editor/common/language.js +9 -0
- package/dist/workers/editor/common/languageBracketsConfiguration.js +133 -0
- package/dist/workers/editor/common/languageConfiguration.js +138 -0
- package/dist/workers/editor/common/languageConfigurationRegistry.js +361 -0
- package/dist/workers/editor/common/languageFeatureDebounce.js +137 -0
- package/dist/workers/editor/common/languageFeatureRegistry.js +180 -0
- package/dist/workers/editor/common/languageFeatures.js +9 -0
- package/dist/workers/editor/common/languageFeaturesService.js +47 -0
- package/dist/workers/editor/common/languageSelector.js +112 -0
- package/dist/workers/editor/common/languageService.js +92 -0
- package/dist/workers/editor/common/languages.js +522 -0
- package/dist/workers/editor/common/languagesAssociations.js +193 -0
- package/dist/workers/editor/common/languagesRegistry.js +237 -0
- package/dist/workers/editor/common/legacyLinesDiffComputer.js +468 -0
- package/dist/workers/editor/common/length.js +129 -0
- package/dist/workers/editor/common/lineDecorations.js +208 -0
- package/dist/workers/editor/common/lineEdit.js +75 -0
- package/dist/workers/editor/common/lineHeights.js +370 -0
- package/dist/workers/editor/common/linePart.js +25 -0
- package/dist/workers/editor/common/lineRange.js +312 -0
- package/dist/workers/editor/common/lineSequence.js +36 -0
- package/dist/workers/editor/common/lineTokens.js +405 -0
- package/dist/workers/editor/common/linesDiffComputer.js +29 -0
- package/dist/workers/editor/common/linesDiffComputers.js +13 -0
- package/dist/workers/editor/common/linesLayout.js +765 -0
- package/dist/workers/editor/common/linesSliceCharSequence.js +205 -0
- package/dist/workers/editor/common/linkComputer.js +269 -0
- package/dist/workers/editor/common/markerDecorations.js +9 -0
- package/dist/workers/editor/common/markerDecorationsService.js +248 -0
- package/dist/workers/editor/common/minimapTokensColorTracker.js +58 -0
- package/dist/workers/editor/common/mirrorTextModel.js +117 -0
- package/dist/workers/editor/common/model.js +9 -0
- package/dist/workers/editor/common/modelLineProjection.js +350 -0
- package/dist/workers/editor/common/modelLineProjectionData.js +297 -0
- package/dist/workers/editor/common/modelService.js +413 -0
- package/dist/workers/editor/common/modesRegistry.js +75 -0
- package/dist/workers/editor/common/monospaceLineBreaksComputer.js +473 -0
- package/dist/workers/editor/common/myersDiffAlgorithm.js +159 -0
- package/dist/workers/editor/common/nodeReader.js +127 -0
- package/dist/workers/editor/common/nullTokenize.js +29 -0
- package/dist/workers/editor/common/offsetRange.js +225 -0
- package/dist/workers/editor/common/onEnter.js +109 -0
- package/dist/workers/editor/common/oneCursor.js +117 -0
- package/dist/workers/editor/common/overviewZoneManager.js +176 -0
- package/dist/workers/editor/common/parser.js +121 -0
- package/dist/workers/editor/common/pieceTreeBase.js +1473 -0
- package/dist/workers/editor/common/pieceTreeTextBuffer.js +461 -0
- package/dist/workers/editor/common/pieceTreeTextBufferBuilder.js +140 -0
- package/dist/workers/editor/common/point.js +50 -0
- package/dist/workers/editor/common/position.js +142 -0
- package/dist/workers/editor/common/positionToOffset.js +17 -0
- package/dist/workers/editor/common/positionToOffsetImpl.js +98 -0
- package/dist/workers/editor/common/prefixSumComputer.js +226 -0
- package/dist/workers/editor/common/range.js +421 -0
- package/dist/workers/editor/common/rangeMapping.js +229 -0
- package/dist/workers/editor/common/rangeSingleLine.js +17 -0
- package/dist/workers/editor/common/rbTreeBase.js +362 -0
- package/dist/workers/editor/common/rect.js +163 -0
- package/dist/workers/editor/common/replaceCommand.js +158 -0
- package/dist/workers/editor/common/resolverService.js +5 -0
- package/dist/workers/editor/common/rgba.js +35 -0
- package/dist/workers/editor/common/richEditBrackets.js +356 -0
- package/dist/workers/editor/common/selection.js +145 -0
- package/dist/workers/editor/common/semanticTokensDto.js +82 -0
- package/dist/workers/editor/common/semanticTokensProviderStyling.js +263 -0
- package/dist/workers/editor/common/semanticTokensStyling.js +9 -0
- package/dist/workers/editor/common/semanticTokensStylingService.js +47 -0
- package/dist/workers/editor/common/shiftCommand.js +241 -0
- package/dist/workers/editor/common/smallImmutableSet.js +108 -0
- package/dist/workers/editor/common/sparseMultilineTokens.js +548 -0
- package/dist/workers/editor/common/sparseTokensStore.js +210 -0
- package/dist/workers/editor/common/standaloneEnums.js +1017 -0
- package/dist/workers/editor/common/standaloneStrings.js +42 -0
- package/dist/workers/editor/common/stringBuilder.js +122 -0
- package/dist/workers/editor/common/stringEdit.js +165 -0
- package/dist/workers/editor/common/supports.js +58 -0
- package/dist/workers/editor/common/surroundSelectionCommand.js +44 -0
- package/dist/workers/editor/common/textChange.js +248 -0
- package/dist/workers/editor/common/textEdit.js +269 -0
- package/dist/workers/editor/common/textLength.js +87 -0
- package/dist/workers/editor/common/textModel.js +2031 -0
- package/dist/workers/editor/common/textModelBracketPairs.js +45 -0
- package/dist/workers/editor/common/textModelDefaults.js +18 -0
- package/dist/workers/editor/common/textModelEditSource.js +166 -0
- package/dist/workers/editor/common/textModelEvents.js +216 -0
- package/dist/workers/editor/common/textModelGuides.js +40 -0
- package/dist/workers/editor/common/textModelPart.js +23 -0
- package/dist/workers/editor/common/textModelSearch.js +455 -0
- package/dist/workers/editor/common/textModelStringEdit.js +11 -0
- package/dist/workers/editor/common/textModelSync.impl.js +307 -0
- package/dist/workers/editor/common/textModelText.js +26 -0
- package/dist/workers/editor/common/textModelTokens.js +436 -0
- package/dist/workers/editor/common/textResourceConfiguration.js +6 -0
- package/dist/workers/editor/common/textToHtmlTokenizer.js +139 -0
- package/dist/workers/editor/common/tokenStore.js +407 -0
- package/dist/workers/editor/common/tokenWithTextArray.js +73 -0
- package/dist/workers/editor/common/tokenization.js +287 -0
- package/dist/workers/editor/common/tokenizationRegistry.js +123 -0
- package/dist/workers/editor/common/tokenizationTextModelPart.js +275 -0
- package/dist/workers/editor/common/tokenizer.js +301 -0
- package/dist/workers/editor/common/tokenizerSyntaxTokenBackend.js +261 -0
- package/dist/workers/editor/common/treeSitterLibraryService.js +9 -0
- package/dist/workers/editor/common/treeSitterSyntaxTokenBackend.js +167 -0
- package/dist/workers/editor/common/treeSitterThemeService.js +9 -0
- package/dist/workers/editor/common/treeSitterTokenizationImpl.js +713 -0
- package/dist/workers/editor/common/treeSitterTree.js +395 -0
- package/dist/workers/editor/common/treeViewsDnd.js +24 -0
- package/dist/workers/editor/common/treeViewsDndService.js +12 -0
- package/dist/workers/editor/common/trimTrailingWhitespaceCommand.js +98 -0
- package/dist/workers/editor/common/unicodeTextModelHighlighter.js +188 -0
- package/dist/workers/editor/common/utils.js +62 -0
- package/dist/workers/editor/common/viewContext.js +22 -0
- package/dist/workers/editor/common/viewEventHandler.js +186 -0
- package/dist/workers/editor/common/viewEvents.js +180 -0
- package/dist/workers/editor/common/viewLayout.js +368 -0
- package/dist/workers/editor/common/viewLineRenderer.js +948 -0
- package/dist/workers/editor/common/viewLinesViewportData.js +30 -0
- package/dist/workers/editor/common/viewModel.js +98 -0
- package/dist/workers/editor/common/viewModelDecoration.js +55 -0
- package/dist/workers/editor/common/viewModelDecorations.js +132 -0
- package/dist/workers/editor/common/viewModelEventDispatcher.js +398 -0
- package/dist/workers/editor/common/viewModelImpl.js +1163 -0
- package/dist/workers/editor/common/viewModelLines.js +938 -0
- package/dist/workers/editor/common/wordCharacterClassifier.js +87 -0
- package/dist/workers/editor/common/wordHelper.js +127 -0
- package/dist/workers/editor/editor.worker.js +11 -0
- package/dist/workers/language/css.worker.js +8 -0
- package/dist/workers/language/cssMode.js +198 -0
- package/dist/workers/language/cssWorker.js +183 -0
- package/dist/workers/language/html.worker.js +8 -0
- package/dist/workers/language/htmlMode.js +213 -0
- package/dist/workers/language/htmlWorker.js +126 -0
- package/dist/workers/language/json.worker.js +8 -0
- package/dist/workers/language/jsonMode.js +224 -0
- package/dist/workers/language/jsonWorker.js +187 -0
- package/dist/workers/language/languageFeatures.js +1009 -0
- package/dist/workers/language/lib.index.js +103 -0
- package/dist/workers/language/lib.js +1107 -0
- package/dist/workers/language/lspLanguageFeatures.js +716 -0
- package/dist/workers/language/monaco.contribution.js +144 -0
- package/dist/workers/language/tokenization.js +189 -0
- package/dist/workers/language/ts.worker.js +14 -0
- package/dist/workers/language/tsMode.js +212 -0
- package/dist/workers/language/tsWorker.js +352 -0
- package/dist/workers/language/typescriptServices.js +210154 -0
- package/dist/workers/language/typescriptServicesMetadata.js +3 -0
- package/dist/workers/language/workerManager.js +65 -0
- package/package.json +3 -2
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import '../../editor/browser/coreCommands.js';
|
|
2
|
+
import '../../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
3
|
+
import '../../editor/browser/widget/diffEditor/diffEditor.contribution.js';
|
|
4
|
+
import '../../editor/contrib/anchorSelect/browser/anchorSelect.js';
|
|
5
|
+
import '../../editor/contrib/bracketMatching/browser/bracketMatching.js';
|
|
6
|
+
import '../../editor/contrib/caretOperations/browser/caretOperations.js';
|
|
7
|
+
import '../../editor/contrib/caretOperations/browser/transpose.js';
|
|
8
|
+
import '../../editor/contrib/clipboard/browser/clipboard.js';
|
|
9
|
+
import '../../editor/contrib/codeAction/browser/codeActionContributions.js';
|
|
10
|
+
import '../../editor/contrib/codelens/browser/codelensController.js';
|
|
11
|
+
import '../../editor/contrib/colorPicker/browser/colorPickerContribution.js';
|
|
12
|
+
import '../../editor/contrib/comment/browser/comment.js';
|
|
13
|
+
import '../../editor/contrib/contextmenu/browser/contextmenu.js';
|
|
14
|
+
import '../../editor/contrib/cursorUndo/browser/cursorUndo.js';
|
|
15
|
+
import '../../editor/contrib/dnd/browser/dnd.js';
|
|
16
|
+
import '../../editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js';
|
|
17
|
+
import '../../editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js';
|
|
18
|
+
import '../../editor/contrib/find/browser/findController.js';
|
|
19
|
+
import '../../editor/contrib/folding/browser/folding.js';
|
|
20
|
+
import '../../editor/contrib/fontZoom/browser/fontZoom.js';
|
|
21
|
+
import '../../editor/contrib/format/browser/formatActions.js';
|
|
22
|
+
import '../../editor/contrib/documentSymbols/browser/documentSymbols.js';
|
|
23
|
+
import '../../editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js';
|
|
24
|
+
import '../../editor/contrib/inlineProgress/browser/inlineProgress.js';
|
|
25
|
+
import '../../editor/contrib/gotoSymbol/browser/goToCommands.js';
|
|
26
|
+
import '../../editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js';
|
|
27
|
+
import '../../editor/contrib/gotoError/browser/gotoError.js';
|
|
28
|
+
import '../../editor/contrib/gpu/browser/gpuActions.js';
|
|
29
|
+
import '../../editor/contrib/hover/browser/hoverContribution.js';
|
|
30
|
+
import '../../editor/contrib/indentation/browser/indentation.js';
|
|
31
|
+
import '../../editor/contrib/inlayHints/browser/inlayHintsContribution.js';
|
|
32
|
+
import '../../editor/contrib/inPlaceReplace/browser/inPlaceReplace.js';
|
|
33
|
+
import '../../editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js';
|
|
34
|
+
import '../../editor/contrib/lineSelection/browser/lineSelection.js';
|
|
35
|
+
import '../../editor/contrib/linesOperations/browser/linesOperations.js';
|
|
36
|
+
import '../../editor/contrib/linkedEditing/browser/linkedEditing.js';
|
|
37
|
+
import '../../editor/contrib/links/browser/links.js';
|
|
38
|
+
import '../../editor/contrib/longLinesHelper/browser/longLinesHelper.js';
|
|
39
|
+
import '../../editor/contrib/middleScroll/browser/middleScroll.contribution.js';
|
|
40
|
+
import '../../editor/contrib/multicursor/browser/multicursor.js';
|
|
41
|
+
import '../../editor/contrib/parameterHints/browser/parameterHints.js';
|
|
42
|
+
import '../../editor/contrib/placeholderText/browser/placeholderText.contribution.js';
|
|
43
|
+
import '../../editor/contrib/rename/browser/rename.js';
|
|
44
|
+
import '../../editor/contrib/sectionHeaders/browser/sectionHeaders.js';
|
|
45
|
+
import '../../editor/contrib/semanticTokens/browser/documentSemanticTokens.js';
|
|
46
|
+
import '../../editor/contrib/semanticTokens/browser/viewportSemanticTokens.js';
|
|
47
|
+
import '../../editor/contrib/smartSelect/browser/smartSelect.js';
|
|
48
|
+
import '../../editor/contrib/snippet/browser/snippetController2.js';
|
|
49
|
+
import '../../editor/contrib/stickyScroll/browser/stickyScrollContribution.js';
|
|
50
|
+
import '../../editor/contrib/suggest/browser/suggestController.js';
|
|
51
|
+
import '../../editor/contrib/suggest/browser/suggestInlineCompletions.js';
|
|
52
|
+
import '../../editor/contrib/tokenization/browser/tokenization.js';
|
|
53
|
+
import '../../editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js';
|
|
54
|
+
import '../../editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js';
|
|
55
|
+
import '../../editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js';
|
|
56
|
+
import '../../editor/contrib/wordHighlighter/browser/wordHighlighter.js';
|
|
57
|
+
import '../../editor/contrib/wordOperations/browser/wordOperations.js';
|
|
58
|
+
import '../../editor/contrib/wordPartOperations/browser/wordPartOperations.js';
|
|
59
|
+
import '../../editor/contrib/readOnlyMessage/browser/contribution.js';
|
|
60
|
+
import '../../editor/contrib/diffEditorBreadcrumbs/browser/contribution.js';
|
|
61
|
+
import '../../editor/contrib/floatingMenu/browser/floatingMenu.contribution.js';
|
|
62
|
+
import '../../editor/common/standaloneStrings.js';
|
|
63
|
+
import '../../base/browser/ui/codicons/codicon/codicon.css';
|
|
64
|
+
import '../../base/browser/ui/codicons/codicon/codicon-modifiers.css';
|
|
65
|
+
import '../../editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js';
|
|
66
|
+
import '../../editor/standalone/browser/inspectTokens/inspectTokens.js';
|
|
67
|
+
import '../../editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js';
|
|
68
|
+
import '../../editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js';
|
|
69
|
+
import '../../editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js';
|
|
70
|
+
import '../../editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
|
|
71
|
+
import '../../editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js';
|
|
72
|
+
import '../../editor/standalone/browser/toggleHighContrast/toggleHighContrast.js';
|
|
73
|
+
import { languages, Emitter } from '../../editor/editor.api2.js';
|
|
74
|
+
|
|
75
|
+
class LanguageServiceDefaultsImpl {
|
|
76
|
+
constructor(languageId, diagnosticsOptions, modeConfiguration) {
|
|
77
|
+
this._onDidChange = new Emitter();
|
|
78
|
+
this._languageId = languageId;
|
|
79
|
+
this.setDiagnosticsOptions(diagnosticsOptions);
|
|
80
|
+
this.setModeConfiguration(modeConfiguration);
|
|
81
|
+
}
|
|
82
|
+
get onDidChange() {
|
|
83
|
+
return this._onDidChange.event;
|
|
84
|
+
}
|
|
85
|
+
get languageId() {
|
|
86
|
+
return this._languageId;
|
|
87
|
+
}
|
|
88
|
+
get modeConfiguration() {
|
|
89
|
+
return this._modeConfiguration;
|
|
90
|
+
}
|
|
91
|
+
get diagnosticsOptions() {
|
|
92
|
+
return this._diagnosticsOptions;
|
|
93
|
+
}
|
|
94
|
+
setDiagnosticsOptions(options) {
|
|
95
|
+
this._diagnosticsOptions = options || /* @__PURE__ */ Object.create(null);
|
|
96
|
+
this._onDidChange.fire(this);
|
|
97
|
+
}
|
|
98
|
+
setModeConfiguration(modeConfiguration) {
|
|
99
|
+
this._modeConfiguration = modeConfiguration || /* @__PURE__ */ Object.create(null);
|
|
100
|
+
this._onDidChange.fire(this);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const diagnosticDefault = {
|
|
104
|
+
validate: true,
|
|
105
|
+
allowComments: true,
|
|
106
|
+
schemas: [],
|
|
107
|
+
enableSchemaRequest: false,
|
|
108
|
+
schemaRequest: "warning",
|
|
109
|
+
schemaValidation: "warning",
|
|
110
|
+
comments: "error",
|
|
111
|
+
trailingCommas: "error"
|
|
112
|
+
};
|
|
113
|
+
const modeConfigurationDefault = {
|
|
114
|
+
documentFormattingEdits: true,
|
|
115
|
+
documentRangeFormattingEdits: true,
|
|
116
|
+
completionItems: true,
|
|
117
|
+
hovers: true,
|
|
118
|
+
documentSymbols: true,
|
|
119
|
+
tokens: true,
|
|
120
|
+
colors: true,
|
|
121
|
+
foldingRanges: true,
|
|
122
|
+
diagnostics: true,
|
|
123
|
+
selectionRanges: true
|
|
124
|
+
};
|
|
125
|
+
const jsonDefaults = new LanguageServiceDefaultsImpl(
|
|
126
|
+
"json",
|
|
127
|
+
diagnosticDefault,
|
|
128
|
+
modeConfigurationDefault
|
|
129
|
+
);
|
|
130
|
+
const getWorker = () => getMode().then((mode2) => mode2.getWorker());
|
|
131
|
+
function getMode() {
|
|
132
|
+
return import('./jsonMode.js');
|
|
133
|
+
}
|
|
134
|
+
languages.register({
|
|
135
|
+
id: "json",
|
|
136
|
+
extensions: [".json", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".har"],
|
|
137
|
+
aliases: ["JSON", "json"],
|
|
138
|
+
mimetypes: ["application/json"]
|
|
139
|
+
});
|
|
140
|
+
languages.onLanguage("json", () => {
|
|
141
|
+
getMode().then((mode2) => mode2.setupMode(jsonDefaults));
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export { getWorker, jsonDefaults };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { createScanner } from '../../../external/jsonc-parser/lib/esm/main.js';
|
|
2
|
+
|
|
3
|
+
function createTokenizationSupport(supportComments) {
|
|
4
|
+
return {
|
|
5
|
+
getInitialState: () => new JSONState(null, null, false, null),
|
|
6
|
+
tokenize: (line, state) => tokenize(supportComments, line, state)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const TOKEN_DELIM_OBJECT = "delimiter.bracket.json";
|
|
10
|
+
const TOKEN_DELIM_ARRAY = "delimiter.array.json";
|
|
11
|
+
const TOKEN_DELIM_COLON = "delimiter.colon.json";
|
|
12
|
+
const TOKEN_DELIM_COMMA = "delimiter.comma.json";
|
|
13
|
+
const TOKEN_VALUE_BOOLEAN = "keyword.json";
|
|
14
|
+
const TOKEN_VALUE_NULL = "keyword.json";
|
|
15
|
+
const TOKEN_VALUE_STRING = "string.value.json";
|
|
16
|
+
const TOKEN_VALUE_NUMBER = "number.json";
|
|
17
|
+
const TOKEN_PROPERTY_NAME = "string.key.json";
|
|
18
|
+
const TOKEN_COMMENT_BLOCK = "comment.block.json";
|
|
19
|
+
const TOKEN_COMMENT_LINE = "comment.line.json";
|
|
20
|
+
class ParentsStack {
|
|
21
|
+
constructor(parent, type) {
|
|
22
|
+
this.parent = parent;
|
|
23
|
+
this.type = type;
|
|
24
|
+
}
|
|
25
|
+
static pop(parents) {
|
|
26
|
+
if (parents) {
|
|
27
|
+
return parents.parent;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
static push(parents, type) {
|
|
32
|
+
return new ParentsStack(parents, type);
|
|
33
|
+
}
|
|
34
|
+
static equals(a, b) {
|
|
35
|
+
if (!a && !b) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (!a || !b) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
while (a && b) {
|
|
42
|
+
if (a === b) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (a.type !== b.type) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
a = a.parent;
|
|
49
|
+
b = b.parent;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class JSONState {
|
|
55
|
+
constructor(state, scanError, lastWasColon, parents) {
|
|
56
|
+
this._state = state;
|
|
57
|
+
this.scanError = scanError;
|
|
58
|
+
this.lastWasColon = lastWasColon;
|
|
59
|
+
this.parents = parents;
|
|
60
|
+
}
|
|
61
|
+
clone() {
|
|
62
|
+
return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents);
|
|
63
|
+
}
|
|
64
|
+
equals(other) {
|
|
65
|
+
if (other === this) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (!other || !(other instanceof JSONState)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return this.scanError === other.scanError && this.lastWasColon === other.lastWasColon && ParentsStack.equals(this.parents, other.parents);
|
|
72
|
+
}
|
|
73
|
+
getStateData() {
|
|
74
|
+
return this._state;
|
|
75
|
+
}
|
|
76
|
+
setStateData(state) {
|
|
77
|
+
this._state = state;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function tokenize(comments, line, state, offsetDelta = 0) {
|
|
81
|
+
let numberOfInsertedCharacters = 0;
|
|
82
|
+
let adjustOffset = false;
|
|
83
|
+
switch (state.scanError) {
|
|
84
|
+
case 2 /* UnexpectedEndOfString */:
|
|
85
|
+
line = '"' + line;
|
|
86
|
+
numberOfInsertedCharacters = 1;
|
|
87
|
+
break;
|
|
88
|
+
case 1 /* UnexpectedEndOfComment */:
|
|
89
|
+
line = "/*" + line;
|
|
90
|
+
numberOfInsertedCharacters = 2;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
const scanner = createScanner(line);
|
|
94
|
+
let lastWasColon = state.lastWasColon;
|
|
95
|
+
let parents = state.parents;
|
|
96
|
+
const ret = {
|
|
97
|
+
tokens: [],
|
|
98
|
+
endState: state.clone()
|
|
99
|
+
};
|
|
100
|
+
while (true) {
|
|
101
|
+
let offset = offsetDelta + scanner.getPosition();
|
|
102
|
+
let type = "";
|
|
103
|
+
const kind = scanner.scan();
|
|
104
|
+
if (kind === 17 /* EOF */) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
if (offset === offsetDelta + scanner.getPosition()) {
|
|
108
|
+
throw new Error(
|
|
109
|
+
"Scanner did not advance, next 3 characters are: " + line.substr(scanner.getPosition(), 3)
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
if (adjustOffset) {
|
|
113
|
+
offset -= numberOfInsertedCharacters;
|
|
114
|
+
}
|
|
115
|
+
adjustOffset = numberOfInsertedCharacters > 0;
|
|
116
|
+
switch (kind) {
|
|
117
|
+
case 1 /* OpenBraceToken */:
|
|
118
|
+
parents = ParentsStack.push(parents, 0 /* Object */);
|
|
119
|
+
type = TOKEN_DELIM_OBJECT;
|
|
120
|
+
lastWasColon = false;
|
|
121
|
+
break;
|
|
122
|
+
case 2 /* CloseBraceToken */:
|
|
123
|
+
parents = ParentsStack.pop(parents);
|
|
124
|
+
type = TOKEN_DELIM_OBJECT;
|
|
125
|
+
lastWasColon = false;
|
|
126
|
+
break;
|
|
127
|
+
case 3 /* OpenBracketToken */:
|
|
128
|
+
parents = ParentsStack.push(parents, 1 /* Array */);
|
|
129
|
+
type = TOKEN_DELIM_ARRAY;
|
|
130
|
+
lastWasColon = false;
|
|
131
|
+
break;
|
|
132
|
+
case 4 /* CloseBracketToken */:
|
|
133
|
+
parents = ParentsStack.pop(parents);
|
|
134
|
+
type = TOKEN_DELIM_ARRAY;
|
|
135
|
+
lastWasColon = false;
|
|
136
|
+
break;
|
|
137
|
+
case 6 /* ColonToken */:
|
|
138
|
+
type = TOKEN_DELIM_COLON;
|
|
139
|
+
lastWasColon = true;
|
|
140
|
+
break;
|
|
141
|
+
case 5 /* CommaToken */:
|
|
142
|
+
type = TOKEN_DELIM_COMMA;
|
|
143
|
+
lastWasColon = false;
|
|
144
|
+
break;
|
|
145
|
+
case 8 /* TrueKeyword */:
|
|
146
|
+
case 9 /* FalseKeyword */:
|
|
147
|
+
type = TOKEN_VALUE_BOOLEAN;
|
|
148
|
+
lastWasColon = false;
|
|
149
|
+
break;
|
|
150
|
+
case 7 /* NullKeyword */:
|
|
151
|
+
type = TOKEN_VALUE_NULL;
|
|
152
|
+
lastWasColon = false;
|
|
153
|
+
break;
|
|
154
|
+
case 10 /* StringLiteral */:
|
|
155
|
+
const currentParent = parents ? parents.type : 0 /* Object */;
|
|
156
|
+
const inArray = currentParent === 1 /* Array */;
|
|
157
|
+
type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;
|
|
158
|
+
lastWasColon = false;
|
|
159
|
+
break;
|
|
160
|
+
case 11 /* NumericLiteral */:
|
|
161
|
+
type = TOKEN_VALUE_NUMBER;
|
|
162
|
+
lastWasColon = false;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
{
|
|
166
|
+
switch (kind) {
|
|
167
|
+
case 12 /* LineCommentTrivia */:
|
|
168
|
+
type = TOKEN_COMMENT_LINE;
|
|
169
|
+
break;
|
|
170
|
+
case 13 /* BlockCommentTrivia */:
|
|
171
|
+
type = TOKEN_COMMENT_BLOCK;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
ret.endState = new JSONState(
|
|
176
|
+
state.getStateData(),
|
|
177
|
+
scanner.getTokenError(),
|
|
178
|
+
lastWasColon,
|
|
179
|
+
parents
|
|
180
|
+
);
|
|
181
|
+
ret.tokens.push({
|
|
182
|
+
startIndex: offset,
|
|
183
|
+
scopes: type
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return ret;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export { TOKEN_COMMENT_BLOCK, TOKEN_COMMENT_LINE, TOKEN_DELIM_ARRAY, TOKEN_DELIM_COLON, TOKEN_DELIM_COMMA, TOKEN_DELIM_OBJECT, TOKEN_PROPERTY_NAME, TOKEN_VALUE_BOOLEAN, TOKEN_VALUE_NULL, TOKEN_VALUE_NUMBER, TOKEN_VALUE_STRING, createTokenizationSupport };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { initialize } from '../../common/initialize.js';
|
|
2
|
+
import * as typescriptServices from './lib/typescriptServices.js';
|
|
3
|
+
export { typescriptServices as ts };
|
|
4
|
+
import { create } from './tsWorker.js';
|
|
5
|
+
export { TypeScriptWorker } from './tsWorker.js';
|
|
6
|
+
export { libFileMap } from './lib/lib.js';
|
|
7
|
+
|
|
8
|
+
self.onmessage = () => {
|
|
9
|
+
initialize((ctx, createData) => {
|
|
10
|
+
return create(ctx, createData);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { create, initialize };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { WorkerManager } from './workerManager.js';
|
|
2
|
+
import { SuggestAdapter, SignatureHelpAdapter, QuickInfoAdapter, DocumentHighlightAdapter, DefinitionAdapter, LibFiles, ReferenceAdapter, OutlineAdapter, RenameAdapter, FormatAdapter, FormatOnTypeAdapter, CodeActionAdaptor, InlayHintsAdapter, DiagnosticsAdapter } from './languageFeatures.js';
|
|
3
|
+
export { Adapter, FormatHelper, Kind, flattenDiagnosticMessageText } from './languageFeatures.js';
|
|
4
|
+
import '../../editor/browser/coreCommands.js';
|
|
5
|
+
import '../../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
6
|
+
import '../../editor/browser/widget/diffEditor/diffEditor.contribution.js';
|
|
7
|
+
import '../../editor/contrib/anchorSelect/browser/anchorSelect.js';
|
|
8
|
+
import '../../editor/contrib/bracketMatching/browser/bracketMatching.js';
|
|
9
|
+
import '../../editor/contrib/caretOperations/browser/caretOperations.js';
|
|
10
|
+
import '../../editor/contrib/caretOperations/browser/transpose.js';
|
|
11
|
+
import '../../editor/contrib/clipboard/browser/clipboard.js';
|
|
12
|
+
import '../../editor/contrib/codeAction/browser/codeActionContributions.js';
|
|
13
|
+
import '../../editor/contrib/codelens/browser/codelensController.js';
|
|
14
|
+
import '../../editor/contrib/colorPicker/browser/colorPickerContribution.js';
|
|
15
|
+
import '../../editor/contrib/comment/browser/comment.js';
|
|
16
|
+
import '../../editor/contrib/contextmenu/browser/contextmenu.js';
|
|
17
|
+
import '../../editor/contrib/cursorUndo/browser/cursorUndo.js';
|
|
18
|
+
import '../../editor/contrib/dnd/browser/dnd.js';
|
|
19
|
+
import '../../editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js';
|
|
20
|
+
import '../../editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js';
|
|
21
|
+
import '../../editor/contrib/find/browser/findController.js';
|
|
22
|
+
import '../../editor/contrib/folding/browser/folding.js';
|
|
23
|
+
import '../../editor/contrib/fontZoom/browser/fontZoom.js';
|
|
24
|
+
import '../../editor/contrib/format/browser/formatActions.js';
|
|
25
|
+
import '../../editor/contrib/documentSymbols/browser/documentSymbols.js';
|
|
26
|
+
import '../../editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js';
|
|
27
|
+
import '../../editor/contrib/inlineProgress/browser/inlineProgress.js';
|
|
28
|
+
import '../../editor/contrib/gotoSymbol/browser/goToCommands.js';
|
|
29
|
+
import '../../editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js';
|
|
30
|
+
import '../../editor/contrib/gotoError/browser/gotoError.js';
|
|
31
|
+
import '../../editor/contrib/gpu/browser/gpuActions.js';
|
|
32
|
+
import '../../editor/contrib/hover/browser/hoverContribution.js';
|
|
33
|
+
import '../../editor/contrib/indentation/browser/indentation.js';
|
|
34
|
+
import '../../editor/contrib/inlayHints/browser/inlayHintsContribution.js';
|
|
35
|
+
import '../../editor/contrib/inPlaceReplace/browser/inPlaceReplace.js';
|
|
36
|
+
import '../../editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js';
|
|
37
|
+
import '../../editor/contrib/lineSelection/browser/lineSelection.js';
|
|
38
|
+
import '../../editor/contrib/linesOperations/browser/linesOperations.js';
|
|
39
|
+
import '../../editor/contrib/linkedEditing/browser/linkedEditing.js';
|
|
40
|
+
import '../../editor/contrib/links/browser/links.js';
|
|
41
|
+
import '../../editor/contrib/longLinesHelper/browser/longLinesHelper.js';
|
|
42
|
+
import '../../editor/contrib/middleScroll/browser/middleScroll.contribution.js';
|
|
43
|
+
import '../../editor/contrib/multicursor/browser/multicursor.js';
|
|
44
|
+
import '../../editor/contrib/parameterHints/browser/parameterHints.js';
|
|
45
|
+
import '../../editor/contrib/placeholderText/browser/placeholderText.contribution.js';
|
|
46
|
+
import '../../editor/contrib/rename/browser/rename.js';
|
|
47
|
+
import '../../editor/contrib/sectionHeaders/browser/sectionHeaders.js';
|
|
48
|
+
import '../../editor/contrib/semanticTokens/browser/documentSemanticTokens.js';
|
|
49
|
+
import '../../editor/contrib/semanticTokens/browser/viewportSemanticTokens.js';
|
|
50
|
+
import '../../editor/contrib/smartSelect/browser/smartSelect.js';
|
|
51
|
+
import '../../editor/contrib/snippet/browser/snippetController2.js';
|
|
52
|
+
import '../../editor/contrib/stickyScroll/browser/stickyScrollContribution.js';
|
|
53
|
+
import '../../editor/contrib/suggest/browser/suggestController.js';
|
|
54
|
+
import '../../editor/contrib/suggest/browser/suggestInlineCompletions.js';
|
|
55
|
+
import '../../editor/contrib/tokenization/browser/tokenization.js';
|
|
56
|
+
import '../../editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js';
|
|
57
|
+
import '../../editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js';
|
|
58
|
+
import '../../editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js';
|
|
59
|
+
import '../../editor/contrib/wordHighlighter/browser/wordHighlighter.js';
|
|
60
|
+
import '../../editor/contrib/wordOperations/browser/wordOperations.js';
|
|
61
|
+
import '../../editor/contrib/wordPartOperations/browser/wordPartOperations.js';
|
|
62
|
+
import '../../editor/contrib/readOnlyMessage/browser/contribution.js';
|
|
63
|
+
import '../../editor/contrib/diffEditorBreadcrumbs/browser/contribution.js';
|
|
64
|
+
import '../../editor/contrib/floatingMenu/browser/floatingMenu.contribution.js';
|
|
65
|
+
import '../../editor/common/standaloneStrings.js';
|
|
66
|
+
import '../../base/browser/ui/codicons/codicon/codicon.css';
|
|
67
|
+
import '../../base/browser/ui/codicons/codicon/codicon-modifiers.css';
|
|
68
|
+
import '../../editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js';
|
|
69
|
+
import '../../editor/standalone/browser/inspectTokens/inspectTokens.js';
|
|
70
|
+
import '../../editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js';
|
|
71
|
+
import '../../editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js';
|
|
72
|
+
import '../../editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js';
|
|
73
|
+
import '../../editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
|
|
74
|
+
import '../../editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js';
|
|
75
|
+
import '../../editor/standalone/browser/toggleHighContrast/toggleHighContrast.js';
|
|
76
|
+
import { languages } from '../../editor/editor.api2.js';
|
|
77
|
+
|
|
78
|
+
let javaScriptWorker;
|
|
79
|
+
let typeScriptWorker;
|
|
80
|
+
function setupTypeScript(defaults) {
|
|
81
|
+
typeScriptWorker = setupMode(defaults, "typescript");
|
|
82
|
+
}
|
|
83
|
+
function setupJavaScript(defaults) {
|
|
84
|
+
javaScriptWorker = setupMode(defaults, "javascript");
|
|
85
|
+
}
|
|
86
|
+
function getJavaScriptWorker() {
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
if (!javaScriptWorker) {
|
|
89
|
+
return reject("JavaScript not registered!");
|
|
90
|
+
}
|
|
91
|
+
resolve(javaScriptWorker);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function getTypeScriptWorker() {
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
if (!typeScriptWorker) {
|
|
97
|
+
return reject("TypeScript not registered!");
|
|
98
|
+
}
|
|
99
|
+
resolve(typeScriptWorker);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function setupMode(defaults, modeId) {
|
|
103
|
+
const providers = [];
|
|
104
|
+
const client = new WorkerManager(modeId, defaults);
|
|
105
|
+
const worker = (...uris) => {
|
|
106
|
+
return client.getLanguageServiceWorker(...uris);
|
|
107
|
+
};
|
|
108
|
+
const libFiles = new LibFiles(worker);
|
|
109
|
+
function registerProviders() {
|
|
110
|
+
const { modeConfiguration } = defaults;
|
|
111
|
+
disposeAll(providers);
|
|
112
|
+
if (modeConfiguration.completionItems) {
|
|
113
|
+
providers.push(
|
|
114
|
+
languages.registerCompletionItemProvider(
|
|
115
|
+
modeId,
|
|
116
|
+
new SuggestAdapter(worker)
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
if (modeConfiguration.signatureHelp) {
|
|
121
|
+
providers.push(
|
|
122
|
+
languages.registerSignatureHelpProvider(
|
|
123
|
+
modeId,
|
|
124
|
+
new SignatureHelpAdapter(worker)
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
if (modeConfiguration.hovers) {
|
|
129
|
+
providers.push(
|
|
130
|
+
languages.registerHoverProvider(modeId, new QuickInfoAdapter(worker))
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
if (modeConfiguration.documentHighlights) {
|
|
134
|
+
providers.push(
|
|
135
|
+
languages.registerDocumentHighlightProvider(
|
|
136
|
+
modeId,
|
|
137
|
+
new DocumentHighlightAdapter(worker)
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (modeConfiguration.definitions) {
|
|
142
|
+
providers.push(
|
|
143
|
+
languages.registerDefinitionProvider(
|
|
144
|
+
modeId,
|
|
145
|
+
new DefinitionAdapter(libFiles, worker)
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
if (modeConfiguration.references) {
|
|
150
|
+
providers.push(
|
|
151
|
+
languages.registerReferenceProvider(
|
|
152
|
+
modeId,
|
|
153
|
+
new ReferenceAdapter(libFiles, worker)
|
|
154
|
+
)
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
if (modeConfiguration.documentSymbols) {
|
|
158
|
+
providers.push(
|
|
159
|
+
languages.registerDocumentSymbolProvider(
|
|
160
|
+
modeId,
|
|
161
|
+
new OutlineAdapter(worker)
|
|
162
|
+
)
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
if (modeConfiguration.rename) {
|
|
166
|
+
providers.push(
|
|
167
|
+
languages.registerRenameProvider(
|
|
168
|
+
modeId,
|
|
169
|
+
new RenameAdapter(libFiles, worker)
|
|
170
|
+
)
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
if (modeConfiguration.documentRangeFormattingEdits) {
|
|
174
|
+
providers.push(
|
|
175
|
+
languages.registerDocumentRangeFormattingEditProvider(
|
|
176
|
+
modeId,
|
|
177
|
+
new FormatAdapter(worker)
|
|
178
|
+
)
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
if (modeConfiguration.onTypeFormattingEdits) {
|
|
182
|
+
providers.push(
|
|
183
|
+
languages.registerOnTypeFormattingEditProvider(
|
|
184
|
+
modeId,
|
|
185
|
+
new FormatOnTypeAdapter(worker)
|
|
186
|
+
)
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
if (modeConfiguration.codeActions) {
|
|
190
|
+
providers.push(
|
|
191
|
+
languages.registerCodeActionProvider(modeId, new CodeActionAdaptor(worker))
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
if (modeConfiguration.inlayHints) {
|
|
195
|
+
providers.push(
|
|
196
|
+
languages.registerInlayHintsProvider(modeId, new InlayHintsAdapter(worker))
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
if (modeConfiguration.diagnostics) {
|
|
200
|
+
providers.push(new DiagnosticsAdapter(libFiles, defaults, modeId, worker));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
registerProviders();
|
|
204
|
+
return worker;
|
|
205
|
+
}
|
|
206
|
+
function disposeAll(disposables) {
|
|
207
|
+
while (disposables.length) {
|
|
208
|
+
disposables.pop().dispose();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export { CodeActionAdaptor, DefinitionAdapter, DiagnosticsAdapter, DocumentHighlightAdapter, FormatAdapter, FormatOnTypeAdapter, InlayHintsAdapter, LibFiles, OutlineAdapter, QuickInfoAdapter, ReferenceAdapter, RenameAdapter, SignatureHelpAdapter, SuggestAdapter, WorkerManager, getJavaScriptWorker, getTypeScriptWorker, setupJavaScript, setupTypeScript };
|