@codingame/monaco-vscode-standalone-html-language-features 35.0.2 → 36.0.0
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/editor/editor.api.d.ts +117 -18
- package/{common → internal/common}/workers.js +13 -2
- package/language/html/html.worker.js +1 -8
- package/language/html/monaco.contribution.js +1 -110
- package/languages/features/html/html.worker.js +8 -0
- package/{language/html/monaco.contribution.d.ts → languages/features/html/register.d.ts} +1 -1
- package/languages/features/html/register.js +110 -0
- package/{language → languages/features}/html/workerManager.js +1 -1
- package/package.json +2 -2
- package/common/workers.d.ts +0 -29
- /package/{common → internal/common}/initialize.js +0 -0
- /package/{language → languages/features}/common/lspLanguageFeatures.js +0 -0
- /package/{language → languages/features}/html/htmlMode.js +0 -0
- /package/{language → languages/features}/html/htmlWorker.js +0 -0
package/editor/editor.api.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface CancellationToken {
|
|
|
87
87
|
*
|
|
88
88
|
* @event
|
|
89
89
|
*/
|
|
90
|
-
readonly onCancellationRequested: (listener: (e:
|
|
90
|
+
readonly onCancellationRequested: (listener: (e: void) => unknown, thisArgs?: unknown, disposables?: IDisposable[]) => IDisposable;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986.
|
|
@@ -747,6 +747,9 @@ declare class Range {
|
|
|
747
747
|
* Moves the range by the given amount of lines.
|
|
748
748
|
*/
|
|
749
749
|
delta(lineCount: number): Range;
|
|
750
|
+
/**
|
|
751
|
+
* Test if this range starts and ends on the same line.
|
|
752
|
+
*/
|
|
750
753
|
isSingleLine(): boolean;
|
|
751
754
|
static fromPositions(start: IPosition, end?: IPosition): Range;
|
|
752
755
|
/**
|
|
@@ -1647,7 +1650,7 @@ declare namespace editor {
|
|
|
1647
1650
|
*/
|
|
1648
1651
|
glyphMargin?: IModelDecorationGlyphMarginOptions | null;
|
|
1649
1652
|
/**
|
|
1650
|
-
* If set, the decoration will override the line height of the lines it spans.
|
|
1653
|
+
* If set, the decoration will override the line height of the lines it spans. This value is a multiplier to the default line height.
|
|
1651
1654
|
*/
|
|
1652
1655
|
lineHeight?: number | null;
|
|
1653
1656
|
/**
|
|
@@ -2204,6 +2207,12 @@ declare namespace editor {
|
|
|
2204
2207
|
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
|
2205
2208
|
*/
|
|
2206
2209
|
getCustomLineHeightsDecorations(ownerId?: number): IModelDecoration[];
|
|
2210
|
+
/**
|
|
2211
|
+
* Gets all the decorations that contain custom line heights.
|
|
2212
|
+
* @param range The range to search in
|
|
2213
|
+
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
|
2214
|
+
*/
|
|
2215
|
+
getCustomLineHeightsDecorationsInRange(range: Range, ownerId?: number): IModelDecoration[];
|
|
2207
2216
|
/**
|
|
2208
2217
|
* Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).
|
|
2209
2218
|
*/
|
|
@@ -3487,7 +3496,7 @@ declare namespace editor {
|
|
|
3487
3496
|
* Enable quick suggestions (shadow suggestions)
|
|
3488
3497
|
* Defaults to true.
|
|
3489
3498
|
*/
|
|
3490
|
-
quickSuggestions?: boolean | IQuickSuggestionsOptions;
|
|
3499
|
+
quickSuggestions?: boolean | QuickSuggestionsValue | IQuickSuggestionsOptions;
|
|
3491
3500
|
/**
|
|
3492
3501
|
* Quick suggestions show delay (in ms)
|
|
3493
3502
|
* Defaults to 10 (ms)
|
|
@@ -3557,6 +3566,11 @@ declare namespace editor {
|
|
|
3557
3566
|
* Defaults to false.
|
|
3558
3567
|
*/
|
|
3559
3568
|
formatOnPaste?: boolean;
|
|
3569
|
+
/**
|
|
3570
|
+
* Controls whether double-clicking next to a bracket or quote selects the content inside.
|
|
3571
|
+
* Defaults to true.
|
|
3572
|
+
*/
|
|
3573
|
+
doubleClickSelectsBlock?: boolean;
|
|
3560
3574
|
/**
|
|
3561
3575
|
* Controls if the editor should allow to move selections via drag and drop.
|
|
3562
3576
|
* Defaults to false.
|
|
@@ -3915,7 +3929,7 @@ declare namespace editor {
|
|
|
3915
3929
|
/**
|
|
3916
3930
|
* Diff Algorithm
|
|
3917
3931
|
*/
|
|
3918
|
-
diffAlgorithm?: "legacy" | "advanced";
|
|
3932
|
+
diffAlgorithm?: "legacy" | "advanced" | "advanced-external" | "advanced-wasm";
|
|
3919
3933
|
/**
|
|
3920
3934
|
* Whether the diff editor aria label should be verbose.
|
|
3921
3935
|
*/
|
|
@@ -4076,6 +4090,10 @@ declare namespace editor {
|
|
|
4076
4090
|
* Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found
|
|
4077
4091
|
*/
|
|
4078
4092
|
loop?: boolean;
|
|
4093
|
+
/**
|
|
4094
|
+
* Controls whether to close the Find Widget after an explicit find navigation command lands on a match.
|
|
4095
|
+
*/
|
|
4096
|
+
closeOnResult?: boolean;
|
|
4079
4097
|
}
|
|
4080
4098
|
export type GoToLocationValues = "peek" | "gotoAndPeek" | "goto";
|
|
4081
4099
|
/**
|
|
@@ -4102,9 +4120,9 @@ declare namespace editor {
|
|
|
4102
4120
|
export interface IEditorHoverOptions {
|
|
4103
4121
|
/**
|
|
4104
4122
|
* Enable the hover.
|
|
4105
|
-
* Defaults to
|
|
4123
|
+
* Defaults to 'on'.
|
|
4106
4124
|
*/
|
|
4107
|
-
enabled?:
|
|
4125
|
+
enabled?: "on" | "off" | "onKeyboardModifier";
|
|
4108
4126
|
/**
|
|
4109
4127
|
* Delay for showing the hover.
|
|
4110
4128
|
* Defaults to 300.
|
|
@@ -4125,6 +4143,11 @@ declare namespace editor {
|
|
|
4125
4143
|
* Defaults to false.
|
|
4126
4144
|
*/
|
|
4127
4145
|
above?: boolean;
|
|
4146
|
+
/**
|
|
4147
|
+
* Should long line warning hovers be shown (tokenization skipped, rendering paused)?
|
|
4148
|
+
* Defaults to true.
|
|
4149
|
+
*/
|
|
4150
|
+
showLongLineWarning?: boolean;
|
|
4128
4151
|
}
|
|
4129
4152
|
/**
|
|
4130
4153
|
* A description for the overview ruler position.
|
|
@@ -4404,7 +4427,7 @@ declare namespace editor {
|
|
|
4404
4427
|
*/
|
|
4405
4428
|
cycle?: boolean;
|
|
4406
4429
|
}
|
|
4407
|
-
export type QuickSuggestionsValue = "on" | "inline" | "off";
|
|
4430
|
+
export type QuickSuggestionsValue = "on" | "inline" | "off" | "offWhenInlineCompletions";
|
|
4408
4431
|
/**
|
|
4409
4432
|
* Configuration options for quick suggestions
|
|
4410
4433
|
*/
|
|
@@ -5032,12 +5055,13 @@ declare namespace editor {
|
|
|
5032
5055
|
inlineCompletionsAccessibilityVerbose = 169,
|
|
5033
5056
|
effectiveEditContext = 170,
|
|
5034
5057
|
scrollOnMiddleClick = 171,
|
|
5035
|
-
effectiveAllowVariableFonts = 172
|
|
5058
|
+
effectiveAllowVariableFonts = 172,
|
|
5059
|
+
doubleClickSelectsBlock = 173
|
|
5036
5060
|
}
|
|
5037
5061
|
export const EditorOptions: {
|
|
5038
5062
|
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
|
|
5039
5063
|
acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, "on" | "off" | "smart">;
|
|
5040
|
-
accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport,
|
|
5064
|
+
accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, any>;
|
|
5041
5065
|
accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>;
|
|
5042
5066
|
allowOverflow: IEditorOption<EditorOption.allowOverflow, boolean>;
|
|
5043
5067
|
allowVariableLineHeights: IEditorOption<EditorOption.allowVariableLineHeights, boolean>;
|
|
@@ -5080,6 +5104,7 @@ declare namespace editor {
|
|
|
5080
5104
|
disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>;
|
|
5081
5105
|
disableMonospaceOptimizations: IEditorOption<EditorOption.disableMonospaceOptimizations, boolean>;
|
|
5082
5106
|
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
|
5107
|
+
doubleClickSelectsBlock: IEditorOption<EditorOption.doubleClickSelectsBlock, boolean>;
|
|
5083
5108
|
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
|
5084
5109
|
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
|
5085
5110
|
dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
|
|
@@ -5099,7 +5124,7 @@ declare namespace editor {
|
|
|
5099
5124
|
foldingMaximumRegions: IEditorOption<EditorOption.foldingMaximumRegions, number>;
|
|
5100
5125
|
unfoldOnClickAfterEndOfLine: IEditorOption<EditorOption.unfoldOnClickAfterEndOfLine, boolean>;
|
|
5101
5126
|
fontFamily: IEditorOption<EditorOption.fontFamily, string>;
|
|
5102
|
-
fontInfo: IEditorOption<EditorOption.fontInfo,
|
|
5127
|
+
fontInfo: IEditorOption<EditorOption.fontInfo, any>;
|
|
5103
5128
|
fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>;
|
|
5104
5129
|
fontSize: IEditorOption<EditorOption.fontSize, number>;
|
|
5105
5130
|
fontWeight: IEditorOption<EditorOption.fontWeight, string>;
|
|
@@ -5139,7 +5164,7 @@ declare namespace editor {
|
|
|
5139
5164
|
pasteAs: IEditorOption<EditorOption.pasteAs, Readonly<Required<IPasteAsOptions>>>;
|
|
5140
5165
|
parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>;
|
|
5141
5166
|
peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, "tree" | "editor">;
|
|
5142
|
-
placeholder: IEditorOption<EditorOption.placeholder, string>;
|
|
5167
|
+
placeholder: IEditorOption<EditorOption.placeholder, string | undefined>;
|
|
5143
5168
|
definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>;
|
|
5144
5169
|
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, InternalQuickSuggestionsOptions>;
|
|
5145
5170
|
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
|
|
@@ -5169,7 +5194,7 @@ declare namespace editor {
|
|
|
5169
5194
|
showUnused: IEditorOption<EditorOption.showUnused, boolean>;
|
|
5170
5195
|
showDeprecated: IEditorOption<EditorOption.showDeprecated, boolean>;
|
|
5171
5196
|
inlayHints: IEditorOption<EditorOption.inlayHints, Readonly<Required<IEditorInlayHintsOptions>>>;
|
|
5172
|
-
snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, "none" | "
|
|
5197
|
+
snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, "none" | "inline" | "top" | "bottom">;
|
|
5173
5198
|
smartSelect: IEditorOption<EditorOption.smartSelect, Readonly<Required<ISmartSelectOptions>>>;
|
|
5174
5199
|
smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>;
|
|
5175
5200
|
stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
|
|
@@ -5375,6 +5400,11 @@ declare namespace editor {
|
|
|
5375
5400
|
* Render this content widget in a location where it could overflow the editor's view dom node.
|
|
5376
5401
|
*/
|
|
5377
5402
|
allowEditorOverflow?: boolean;
|
|
5403
|
+
/**
|
|
5404
|
+
* If true, this widget doesn't have a visual representation.
|
|
5405
|
+
* The element will have display set to 'none'.
|
|
5406
|
+
*/
|
|
5407
|
+
useDisplayNone?: boolean;
|
|
5378
5408
|
/**
|
|
5379
5409
|
* Call preventDefault() on mousedown events that target the content widget.
|
|
5380
5410
|
*/
|
|
@@ -5460,7 +5490,7 @@ declare namespace editor {
|
|
|
5460
5490
|
* When set, stacks with other overlay widgets with the same preference,
|
|
5461
5491
|
* in an order determined by the ordinal value.
|
|
5462
5492
|
*/
|
|
5463
|
-
|
|
5493
|
+
stackOrdinal?: number;
|
|
5464
5494
|
}
|
|
5465
5495
|
/**
|
|
5466
5496
|
* An overlay widgets renders on top of the text.
|
|
@@ -5886,6 +5916,7 @@ declare namespace editor {
|
|
|
5886
5916
|
* Fires after the editor completes the operation it fired `onBeginUpdate` for.
|
|
5887
5917
|
*/
|
|
5888
5918
|
readonly onEndUpdate: IEvent<void>;
|
|
5919
|
+
readonly onDidChangeViewZones: IEvent<void>;
|
|
5889
5920
|
/**
|
|
5890
5921
|
* Saves current view state of the editor in a serializable object.
|
|
5891
5922
|
*/
|
|
@@ -6019,6 +6050,10 @@ declare namespace editor {
|
|
|
6019
6050
|
* @param command The commands to execute
|
|
6020
6051
|
*/
|
|
6021
6052
|
executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void;
|
|
6053
|
+
/**
|
|
6054
|
+
* Scroll vertically or horizontally as necessary and reveal the current cursors.
|
|
6055
|
+
*/
|
|
6056
|
+
revealAllCursors(revealHorizontal: boolean, minimalReveal?: boolean): void;
|
|
6022
6057
|
/**
|
|
6023
6058
|
* Get all the decorations on a line (filtering out decorations from other editors).
|
|
6024
6059
|
*/
|
|
@@ -6128,10 +6163,15 @@ declare namespace editor {
|
|
|
6128
6163
|
* Use this method with caution.
|
|
6129
6164
|
*/
|
|
6130
6165
|
getOffsetForColumn(lineNumber: number, column: number): number;
|
|
6166
|
+
getWidthOfLine(lineNumber: number): number;
|
|
6131
6167
|
/**
|
|
6132
6168
|
* Force an editor render now.
|
|
6133
6169
|
*/
|
|
6134
6170
|
render(forceRedraw?: boolean): void;
|
|
6171
|
+
/**
|
|
6172
|
+
* Render the editor at the next animation frame.
|
|
6173
|
+
*/
|
|
6174
|
+
renderAsync(forceRedraw?: boolean): void;
|
|
6135
6175
|
/**
|
|
6136
6176
|
* Get the hit test target at coordinates `clientX` and `clientY`.
|
|
6137
6177
|
* The coordinates are relative to the top-left of the viewport.
|
|
@@ -6722,7 +6762,6 @@ declare namespace languages {
|
|
|
6722
6762
|
* Describes language specific folding markers such as '#region' and '#endregion'.
|
|
6723
6763
|
* The start and end regexes will be tested against the contents of all lines and must be designed efficiently:
|
|
6724
6764
|
* - the regex should start with '^'
|
|
6725
|
-
* - regexp flags (i, g) are ignored
|
|
6726
6765
|
*/
|
|
6727
6766
|
export interface FoldingMarkers {
|
|
6728
6767
|
start: RegExp;
|
|
@@ -7148,6 +7187,17 @@ declare namespace languages {
|
|
|
7148
7187
|
*/
|
|
7149
7188
|
Explicit = 1
|
|
7150
7189
|
}
|
|
7190
|
+
/**
|
|
7191
|
+
* Arbitrary data that the provider can pass when firing {@link InlineCompletionsProvider.onDidChangeInlineCompletions}.
|
|
7192
|
+
* This data is passed back to the provider in {@link InlineCompletionContext.changeHint}.
|
|
7193
|
+
*/
|
|
7194
|
+
export interface IInlineCompletionChangeHint {
|
|
7195
|
+
/**
|
|
7196
|
+
* Arbitrary data that the provider can use to identify what triggered the change.
|
|
7197
|
+
* This data must be JSON serializable.
|
|
7198
|
+
*/
|
|
7199
|
+
readonly data?: unknown;
|
|
7200
|
+
}
|
|
7151
7201
|
export interface InlineCompletionContext {
|
|
7152
7202
|
/**
|
|
7153
7203
|
* How the completion was triggered.
|
|
@@ -7158,6 +7208,29 @@ declare namespace languages {
|
|
|
7158
7208
|
readonly includeInlineCompletions: boolean;
|
|
7159
7209
|
readonly requestIssuedDateTime: number;
|
|
7160
7210
|
readonly earliestShownDateTime: number;
|
|
7211
|
+
/**
|
|
7212
|
+
* The change hint that was passed to {@link InlineCompletionsProvider.onDidChangeInlineCompletions}.
|
|
7213
|
+
* Only set if this request was triggered by such an event.
|
|
7214
|
+
*/
|
|
7215
|
+
readonly changeHint?: IInlineCompletionChangeHint;
|
|
7216
|
+
}
|
|
7217
|
+
export interface IInlineCompletionModelInfo {
|
|
7218
|
+
models: IInlineCompletionModel[];
|
|
7219
|
+
currentModelId: string;
|
|
7220
|
+
}
|
|
7221
|
+
export interface IInlineCompletionModel {
|
|
7222
|
+
name: string;
|
|
7223
|
+
id: string;
|
|
7224
|
+
}
|
|
7225
|
+
export interface IInlineCompletionProviderOption {
|
|
7226
|
+
readonly id: string;
|
|
7227
|
+
readonly label: string;
|
|
7228
|
+
readonly values: readonly IInlineCompletionProviderOptionValue[];
|
|
7229
|
+
readonly currentValueId: string;
|
|
7230
|
+
}
|
|
7231
|
+
export interface IInlineCompletionProviderOptionValue {
|
|
7232
|
+
readonly id: string;
|
|
7233
|
+
readonly label: string;
|
|
7161
7234
|
}
|
|
7162
7235
|
export class SelectedSuggestionInfo {
|
|
7163
7236
|
readonly range: IRange;
|
|
@@ -7216,11 +7289,14 @@ declare namespace languages {
|
|
|
7216
7289
|
/** Only show the inline suggestion when the cursor is in the showRange. */
|
|
7217
7290
|
readonly showRange?: IRange;
|
|
7218
7291
|
readonly warning?: InlineCompletionWarning;
|
|
7219
|
-
readonly hint?:
|
|
7292
|
+
readonly hint?: IInlineCompletionHint;
|
|
7293
|
+
readonly supportsRename?: boolean;
|
|
7220
7294
|
/**
|
|
7221
7295
|
* Used for telemetry.
|
|
7222
7296
|
*/
|
|
7223
7297
|
readonly correlationId?: string | undefined;
|
|
7298
|
+
readonly jumpToPosition?: IPosition;
|
|
7299
|
+
readonly doNotLog?: boolean;
|
|
7224
7300
|
}
|
|
7225
7301
|
export interface InlineCompletionWarning {
|
|
7226
7302
|
message: IMarkdownString | string;
|
|
@@ -7230,12 +7306,11 @@ declare namespace languages {
|
|
|
7230
7306
|
Code = 1,
|
|
7231
7307
|
Label = 2
|
|
7232
7308
|
}
|
|
7233
|
-
export interface
|
|
7309
|
+
export interface IInlineCompletionHint {
|
|
7234
7310
|
/** Refers to the current document. */
|
|
7235
7311
|
range: IRange;
|
|
7236
7312
|
style: InlineCompletionHintStyle;
|
|
7237
7313
|
content: string;
|
|
7238
|
-
jumpToEdit: boolean;
|
|
7239
7314
|
}
|
|
7240
7315
|
export type IconPath = editor.ThemeIcon;
|
|
7241
7316
|
export interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {
|
|
@@ -7280,7 +7355,12 @@ declare namespace languages {
|
|
|
7280
7355
|
* Will be called when a completions list is no longer in use and can be garbage-collected.
|
|
7281
7356
|
*/
|
|
7282
7357
|
disposeInlineCompletions(completions: T, reason: InlineCompletionsDisposeReason): void;
|
|
7283
|
-
|
|
7358
|
+
/**
|
|
7359
|
+
* Fired when the provider wants to trigger a new completion request.
|
|
7360
|
+
* The event can pass a {@link IInlineCompletionChangeHint} which will be
|
|
7361
|
+
* included in the {@link InlineCompletionContext} of the subsequent request.
|
|
7362
|
+
*/
|
|
7363
|
+
onDidChangeInlineCompletions?: IEvent<IInlineCompletionChangeHint | void>;
|
|
7284
7364
|
/**
|
|
7285
7365
|
* Only used for {@link yieldsToGroupIds}.
|
|
7286
7366
|
* Multiple providers can have the same group id.
|
|
@@ -7294,6 +7374,12 @@ declare namespace languages {
|
|
|
7294
7374
|
excludesGroupIds?: InlineCompletionProviderGroupId[];
|
|
7295
7375
|
displayName?: string;
|
|
7296
7376
|
debounceDelayMs?: number;
|
|
7377
|
+
modelInfo?: IInlineCompletionModelInfo;
|
|
7378
|
+
onDidModelInfoChange?: IEvent<void>;
|
|
7379
|
+
setModelId?(modelId: string): Promise<void>;
|
|
7380
|
+
providerOptions?: readonly IInlineCompletionProviderOption[];
|
|
7381
|
+
onDidProviderOptionsChange?: IEvent<void>;
|
|
7382
|
+
setProviderOption?(optionId: string, valueId: string): Promise<void>;
|
|
7297
7383
|
toString?(): string;
|
|
7298
7384
|
}
|
|
7299
7385
|
export type InlineCompletionsDisposeReason = {
|
|
@@ -7306,6 +7392,7 @@ declare namespace languages {
|
|
|
7306
7392
|
}
|
|
7307
7393
|
export type InlineCompletionEndOfLifeReason<TInlineCompletion = InlineCompletion> = {
|
|
7308
7394
|
kind: InlineCompletionEndOfLifeReasonKind.Accepted;
|
|
7395
|
+
alternativeAction: boolean;
|
|
7309
7396
|
} | {
|
|
7310
7397
|
kind: InlineCompletionEndOfLifeReasonKind.Rejected;
|
|
7311
7398
|
} | {
|
|
@@ -7324,6 +7411,7 @@ declare namespace languages {
|
|
|
7324
7411
|
shownDuration: number;
|
|
7325
7412
|
shownDurationUncollapsed: number;
|
|
7326
7413
|
timeUntilShown: number | undefined;
|
|
7414
|
+
timeUntilActuallyShown: number | undefined;
|
|
7327
7415
|
timeUntilProviderRequest: number;
|
|
7328
7416
|
timeUntilProviderResponse: number;
|
|
7329
7417
|
notShownReason: string | undefined;
|
|
@@ -7332,6 +7420,7 @@ declare namespace languages {
|
|
|
7332
7420
|
preceeded: boolean;
|
|
7333
7421
|
languageId: string;
|
|
7334
7422
|
requestReason: string;
|
|
7423
|
+
performanceMarkers?: string;
|
|
7335
7424
|
cursorColumnDistance?: number;
|
|
7336
7425
|
cursorLineDistance?: number;
|
|
7337
7426
|
lineCountOriginal?: number;
|
|
@@ -7344,6 +7433,16 @@ declare namespace languages {
|
|
|
7344
7433
|
typingIntervalCharacterCount: number;
|
|
7345
7434
|
selectedSuggestionInfo: boolean;
|
|
7346
7435
|
availableProviders: string;
|
|
7436
|
+
skuPlan: string | undefined;
|
|
7437
|
+
skuType: string | undefined;
|
|
7438
|
+
renameCreated: boolean | undefined;
|
|
7439
|
+
renameDuration: number | undefined;
|
|
7440
|
+
renameTimedOut: boolean | undefined;
|
|
7441
|
+
renameDroppedOtherEdits: number | undefined;
|
|
7442
|
+
renameDroppedRenameEdits: number | undefined;
|
|
7443
|
+
editKind: string | undefined;
|
|
7444
|
+
longDistanceHintVisible?: boolean;
|
|
7445
|
+
longDistanceHintDistance?: number;
|
|
7347
7446
|
};
|
|
7348
7447
|
export interface CodeAction {
|
|
7349
7448
|
title: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { editor } from 'monaco-editor';
|
|
3
2
|
|
|
4
3
|
function createTrustedTypesPolicy(policyName, policyOptions) {
|
|
@@ -26,6 +25,17 @@ if (typeof self === "object" && self.constructor && self.constructor.name === "D
|
|
|
26
25
|
createScriptURL: (value) => value
|
|
27
26
|
});
|
|
28
27
|
}
|
|
28
|
+
function whenESMWorkerReady(worker) {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
worker.onmessage = function(e) {
|
|
31
|
+
if (e.data.type === "vscode-worker-ready") {
|
|
32
|
+
worker.onmessage = null;
|
|
33
|
+
resolve(worker);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
worker.onerror = reject;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
29
39
|
function getWorkerBootstrapUrl(workerScriptUrl, workerOptions) {
|
|
30
40
|
const blob = new Blob([[
|
|
31
41
|
`${workerOptions.type === "module" ? "await import" : "importScripts"}(${JSON.stringify(workerScriptUrl)});`,
|
|
@@ -63,7 +73,8 @@ function createWebWorker(opts) {
|
|
|
63
73
|
moduleId: opts.moduleId,
|
|
64
74
|
createWorker: opts.createWorker
|
|
65
75
|
})
|
|
66
|
-
).then((w) => {
|
|
76
|
+
).then(async (w) => {
|
|
77
|
+
await whenESMWorkerReady(w);
|
|
67
78
|
w.postMessage("ignore");
|
|
68
79
|
w.postMessage(opts.createData);
|
|
69
80
|
return w;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HTMLWorker } from './htmlWorker.js';
|
|
3
|
-
|
|
4
|
-
self.onmessage = () => {
|
|
5
|
-
initialize((ctx, createData) => {
|
|
6
|
-
return new HTMLWorker(ctx, createData);
|
|
7
|
-
});
|
|
8
|
-
};
|
|
1
|
+
import '../../languages/features/html/html.worker.js';
|
|
@@ -1,110 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { languages, Emitter } from 'monaco-editor';
|
|
3
|
-
|
|
4
|
-
class LanguageServiceDefaultsImpl {
|
|
5
|
-
constructor(languageId, options, modeConfiguration) {
|
|
6
|
-
this._onDidChange = new Emitter();
|
|
7
|
-
this._languageId = languageId;
|
|
8
|
-
this.setOptions(options);
|
|
9
|
-
this.setModeConfiguration(modeConfiguration);
|
|
10
|
-
}
|
|
11
|
-
get onDidChange() {
|
|
12
|
-
return this._onDidChange.event;
|
|
13
|
-
}
|
|
14
|
-
get languageId() {
|
|
15
|
-
return this._languageId;
|
|
16
|
-
}
|
|
17
|
-
get options() {
|
|
18
|
-
return this._options;
|
|
19
|
-
}
|
|
20
|
-
get modeConfiguration() {
|
|
21
|
-
return this._modeConfiguration;
|
|
22
|
-
}
|
|
23
|
-
setOptions(options) {
|
|
24
|
-
this._options = options || /* @__PURE__ */ Object.create(null);
|
|
25
|
-
this._onDidChange.fire(this);
|
|
26
|
-
}
|
|
27
|
-
setModeConfiguration(modeConfiguration) {
|
|
28
|
-
this._modeConfiguration = modeConfiguration || /* @__PURE__ */ Object.create(null);
|
|
29
|
-
this._onDidChange.fire(this);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const formatDefaults = {
|
|
33
|
-
tabSize: 4,
|
|
34
|
-
insertSpaces: false,
|
|
35
|
-
wrapLineLength: 120,
|
|
36
|
-
unformatted: 'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',
|
|
37
|
-
contentUnformatted: "pre",
|
|
38
|
-
indentInnerHtml: false,
|
|
39
|
-
preserveNewLines: true,
|
|
40
|
-
maxPreserveNewLines: void 0,
|
|
41
|
-
indentHandlebars: false,
|
|
42
|
-
endWithNewline: false,
|
|
43
|
-
extraLiners: "head, body, /html",
|
|
44
|
-
wrapAttributes: "auto"
|
|
45
|
-
};
|
|
46
|
-
const optionsDefault = {
|
|
47
|
-
format: formatDefaults,
|
|
48
|
-
suggest: {},
|
|
49
|
-
data: { useDefaultDataProvider: true }
|
|
50
|
-
};
|
|
51
|
-
function getConfigurationDefault(languageId) {
|
|
52
|
-
return {
|
|
53
|
-
completionItems: true,
|
|
54
|
-
hovers: true,
|
|
55
|
-
documentSymbols: true,
|
|
56
|
-
links: true,
|
|
57
|
-
documentHighlights: true,
|
|
58
|
-
rename: true,
|
|
59
|
-
colors: true,
|
|
60
|
-
foldingRanges: true,
|
|
61
|
-
selectionRanges: true,
|
|
62
|
-
diagnostics: languageId === htmlLanguageId,
|
|
63
|
-
// turned off for Razor and Handlebar
|
|
64
|
-
documentFormattingEdits: languageId === htmlLanguageId,
|
|
65
|
-
// turned off for Razor and Handlebar
|
|
66
|
-
documentRangeFormattingEdits: languageId === htmlLanguageId
|
|
67
|
-
// turned off for Razor and Handlebar
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const htmlLanguageId = "html";
|
|
71
|
-
const handlebarsLanguageId = "handlebars";
|
|
72
|
-
const razorLanguageId = "razor";
|
|
73
|
-
const htmlLanguageService = registerHTMLLanguageService(
|
|
74
|
-
htmlLanguageId,
|
|
75
|
-
optionsDefault,
|
|
76
|
-
getConfigurationDefault(htmlLanguageId)
|
|
77
|
-
);
|
|
78
|
-
const htmlDefaults = htmlLanguageService.defaults;
|
|
79
|
-
const handlebarLanguageService = registerHTMLLanguageService(
|
|
80
|
-
handlebarsLanguageId,
|
|
81
|
-
optionsDefault,
|
|
82
|
-
getConfigurationDefault(handlebarsLanguageId)
|
|
83
|
-
);
|
|
84
|
-
const handlebarDefaults = handlebarLanguageService.defaults;
|
|
85
|
-
const razorLanguageService = registerHTMLLanguageService(
|
|
86
|
-
razorLanguageId,
|
|
87
|
-
optionsDefault,
|
|
88
|
-
getConfigurationDefault(razorLanguageId)
|
|
89
|
-
);
|
|
90
|
-
const razorDefaults = razorLanguageService.defaults;
|
|
91
|
-
function getMode() {
|
|
92
|
-
return import('./htmlMode.js');
|
|
93
|
-
}
|
|
94
|
-
function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
|
|
95
|
-
const defaults = new LanguageServiceDefaultsImpl(languageId, options, modeConfiguration);
|
|
96
|
-
let mode2;
|
|
97
|
-
const onLanguageListener = languages.onLanguage(languageId, async () => {
|
|
98
|
-
mode2 = (await getMode()).setupMode(defaults);
|
|
99
|
-
});
|
|
100
|
-
return {
|
|
101
|
-
defaults,
|
|
102
|
-
dispose() {
|
|
103
|
-
onLanguageListener.dispose();
|
|
104
|
-
mode2?.dispose();
|
|
105
|
-
mode2 = void 0;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export { handlebarDefaults, handlebarLanguageService, htmlDefaults, htmlLanguageService, razorDefaults, razorLanguageService, registerHTMLLanguageService };
|
|
1
|
+
export { handlebarDefaults, handlebarLanguageService, htmlDefaults, htmlLanguageService, razorDefaults, razorLanguageService, registerHTMLLanguageService } from '../../languages/features/html/register.js';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
|
|
2
|
+
import { languages, Emitter } from 'monaco-editor';
|
|
3
|
+
|
|
4
|
+
class LanguageServiceDefaultsImpl {
|
|
5
|
+
constructor(languageId, options, modeConfiguration) {
|
|
6
|
+
this._onDidChange = new Emitter();
|
|
7
|
+
this._languageId = languageId;
|
|
8
|
+
this.setOptions(options);
|
|
9
|
+
this.setModeConfiguration(modeConfiguration);
|
|
10
|
+
}
|
|
11
|
+
get onDidChange() {
|
|
12
|
+
return this._onDidChange.event;
|
|
13
|
+
}
|
|
14
|
+
get languageId() {
|
|
15
|
+
return this._languageId;
|
|
16
|
+
}
|
|
17
|
+
get options() {
|
|
18
|
+
return this._options;
|
|
19
|
+
}
|
|
20
|
+
get modeConfiguration() {
|
|
21
|
+
return this._modeConfiguration;
|
|
22
|
+
}
|
|
23
|
+
setOptions(options) {
|
|
24
|
+
this._options = options || /* @__PURE__ */ Object.create(null);
|
|
25
|
+
this._onDidChange.fire(this);
|
|
26
|
+
}
|
|
27
|
+
setModeConfiguration(modeConfiguration) {
|
|
28
|
+
this._modeConfiguration = modeConfiguration || /* @__PURE__ */ Object.create(null);
|
|
29
|
+
this._onDidChange.fire(this);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const formatDefaults = {
|
|
33
|
+
tabSize: 4,
|
|
34
|
+
insertSpaces: false,
|
|
35
|
+
wrapLineLength: 120,
|
|
36
|
+
unformatted: 'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',
|
|
37
|
+
contentUnformatted: "pre",
|
|
38
|
+
indentInnerHtml: false,
|
|
39
|
+
preserveNewLines: true,
|
|
40
|
+
maxPreserveNewLines: void 0,
|
|
41
|
+
indentHandlebars: false,
|
|
42
|
+
endWithNewline: false,
|
|
43
|
+
extraLiners: "head, body, /html",
|
|
44
|
+
wrapAttributes: "auto"
|
|
45
|
+
};
|
|
46
|
+
const optionsDefault = {
|
|
47
|
+
format: formatDefaults,
|
|
48
|
+
suggest: {},
|
|
49
|
+
data: { useDefaultDataProvider: true }
|
|
50
|
+
};
|
|
51
|
+
function getConfigurationDefault(languageId) {
|
|
52
|
+
return {
|
|
53
|
+
completionItems: true,
|
|
54
|
+
hovers: true,
|
|
55
|
+
documentSymbols: true,
|
|
56
|
+
links: true,
|
|
57
|
+
documentHighlights: true,
|
|
58
|
+
rename: true,
|
|
59
|
+
colors: true,
|
|
60
|
+
foldingRanges: true,
|
|
61
|
+
selectionRanges: true,
|
|
62
|
+
diagnostics: languageId === htmlLanguageId,
|
|
63
|
+
// turned off for Razor and Handlebar
|
|
64
|
+
documentFormattingEdits: languageId === htmlLanguageId,
|
|
65
|
+
// turned off for Razor and Handlebar
|
|
66
|
+
documentRangeFormattingEdits: languageId === htmlLanguageId
|
|
67
|
+
// turned off for Razor and Handlebar
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const htmlLanguageId = "html";
|
|
71
|
+
const handlebarsLanguageId = "handlebars";
|
|
72
|
+
const razorLanguageId = "razor";
|
|
73
|
+
const htmlLanguageService = registerHTMLLanguageService(
|
|
74
|
+
htmlLanguageId,
|
|
75
|
+
optionsDefault,
|
|
76
|
+
getConfigurationDefault(htmlLanguageId)
|
|
77
|
+
);
|
|
78
|
+
const htmlDefaults = htmlLanguageService.defaults;
|
|
79
|
+
const handlebarLanguageService = registerHTMLLanguageService(
|
|
80
|
+
handlebarsLanguageId,
|
|
81
|
+
optionsDefault,
|
|
82
|
+
getConfigurationDefault(handlebarsLanguageId)
|
|
83
|
+
);
|
|
84
|
+
const handlebarDefaults = handlebarLanguageService.defaults;
|
|
85
|
+
const razorLanguageService = registerHTMLLanguageService(
|
|
86
|
+
razorLanguageId,
|
|
87
|
+
optionsDefault,
|
|
88
|
+
getConfigurationDefault(razorLanguageId)
|
|
89
|
+
);
|
|
90
|
+
const razorDefaults = razorLanguageService.defaults;
|
|
91
|
+
function getMode() {
|
|
92
|
+
return import('./htmlMode.js');
|
|
93
|
+
}
|
|
94
|
+
function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
|
|
95
|
+
const defaults = new LanguageServiceDefaultsImpl(languageId, options, modeConfiguration);
|
|
96
|
+
let mode2;
|
|
97
|
+
const onLanguageListener = languages.onLanguage(languageId, async () => {
|
|
98
|
+
mode2 = (await getMode()).setupMode(defaults);
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
defaults,
|
|
102
|
+
dispose() {
|
|
103
|
+
onLanguageListener.dispose();
|
|
104
|
+
mode2?.dispose();
|
|
105
|
+
mode2 = void 0;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export { handlebarDefaults, handlebarLanguageService, htmlDefaults, htmlLanguageService, razorDefaults, razorLanguageService, registerHTMLLanguageService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-standalone-html-language-features",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "36.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"main": "./language/html/monaco.contribution.js",
|
|
26
26
|
"module": "./language/html/monaco.contribution.js",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@
|
|
28
|
+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@36.0.0",
|
|
29
29
|
"vscode-html-languageservice": "5.2.0",
|
|
30
30
|
"vscode-languageserver-textdocument": "1.0.12",
|
|
31
31
|
"vscode-languageserver-types": "3.17.5"
|
package/common/workers.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { editor } from "../editor/editor.api.js";
|
|
2
|
-
declare function createWebWorker<T extends object>(opts: IWebWorkerOptions): editor.MonacoWebWorker<T>;
|
|
3
|
-
interface IWebWorkerOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The AMD moduleId to load.
|
|
6
|
-
* It should export a function `create` that should return the exported proxy.
|
|
7
|
-
*/
|
|
8
|
-
moduleId: string;
|
|
9
|
-
createWorker?: () => Worker;
|
|
10
|
-
/**
|
|
11
|
-
* The data to send over when calling create on the module.
|
|
12
|
-
*/
|
|
13
|
-
createData?: any;
|
|
14
|
-
/**
|
|
15
|
-
* A label to be used to identify the web worker for debugging purposes.
|
|
16
|
-
*/
|
|
17
|
-
label?: string;
|
|
18
|
-
/**
|
|
19
|
-
* An object that can be used by the web worker to make calls back to the main thread.
|
|
20
|
-
*/
|
|
21
|
-
host?: any;
|
|
22
|
-
/**
|
|
23
|
-
* Keep idle models.
|
|
24
|
-
* Defaults to false, which means that idle models will stop syncing after a while.
|
|
25
|
-
*/
|
|
26
|
-
keepIdleModels?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export { createWebWorker };
|
|
29
|
-
export type { IWebWorkerOptions };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|