Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .eslint-allowed-bracket-notation-files
Original file line number Diff line number Diff line change
Expand Up @@ -476,30 +476,6 @@ src/vs/platform/webContentExtractor/test/electron-main/webPageLoader.test.ts
src/vs/workbench/contrib/remote/browser/remoteStartEntry.ts
src/vs/workbench/contrib/remoteTunnel/test/electron-browser/remoteTunnel.contribution.test.ts

# Language feature extensions (22 files)
extensions/css-language-features/client/src/node/cssClientMain.ts
extensions/css-language-features/server/src/cssServer.ts
extensions/css-language-features/server/src/node/cssServerNodeMain.ts
extensions/emmet/src/abbreviationActions.ts
extensions/emmet/src/defaultCompletionProvider.ts
extensions/emmet/src/splitJoinTag.ts
extensions/emmet/src/util.ts
extensions/html-language-features/client/src/autoInsertion.ts
extensions/html-language-features/client/src/node/htmlClientMain.ts
extensions/html-language-features/server/src/modes/languageModes.ts
extensions/html-language-features/server/src/node/htmlServerNodeMain.ts
extensions/json-language-features/client/src/node/jsonClientMain.ts
extensions/json-language-features/server/src/node/jsonServerNodeMain.ts
extensions/markdown-language-features/src/extension.ts
extensions/markdown-language-features/src/languageFeatures/copyFiles/copyFiles.ts
extensions/markdown-language-features/src/languageFeatures/copyFiles/snippets.ts
extensions/markdown-language-features/src/markdownEngine.ts
extensions/merge-conflict/src/mergeDecorator.ts
extensions/typescript-language-features/src/logging/telemetry.ts
extensions/typescript-language-features/src/tsServer/serverProcess.electron.ts
extensions/typescript-language-features/src/typescriptServiceClient.ts
extensions/typescript-language-features/src/utils/platform.ts

# Git extension (6 files)
extensions/git/src/askpass-main.ts
extensions/git/src/askpassManager.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function activate(context: ExtensionContext) {
};

// pass the location of the localization bundle to the server
process.env['VSCODE_L10N_BUNDLE_LOCATION'] = l10n.uri?.toString() ?? '';
process.env.VSCODE_L10N_BUNDLE_LOCATION = l10n.uri?.toString() ?? '';

client = await startClient(context, newLanguageClient, { fs: getNodeFSRequestService(), TextDecoder });

Expand Down
2 changes: 1 addition & 1 deletion extensions/css-language-features/server/src/cssServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
let service = languageServices[document.languageId];
if (!service) {
connection.console.log('Document type is ' + document.languageId + ', using css instead.');
service = languageServices['css'];
service = languageServices.css;
}
return service;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as l10n from '@vscode/l10n';
async function setupMain() {
const l10nLog: string[] = [];

const i10lLocation = process.env['VSCODE_L10N_BUNDLE_LOCATION'];
const i10lLocation = process.env.VSCODE_L10N_BUNDLE_LOCATION;
if (i10lLocation) {
try {
await l10n.config({ uri: i10lLocation });
Expand Down
28 changes: 14 additions & 14 deletions extensions/emmet/src/abbreviationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export async function wrapWithAbbreviation(args: any): Promise<boolean> {
const document = editor.document;

args = args || {};
if (!args['language']) {
args['language'] = document.languageId;
if (!args.language) {
args.language = document.languageId;
}
// we know it's not stylesheet due to the validate(false) call above
const syntax = getSyntaxFromArgs(args) || 'html';
Expand Down Expand Up @@ -249,8 +249,8 @@ export async function wrapWithAbbreviation(args: any): Promise<boolean> {
}

const prompt = vscode.l10n.t("Enter Abbreviation");
const inputAbbreviation = (args && args['abbreviation'])
? (args['abbreviation'] as string)
const inputAbbreviation = (args && args.abbreviation)
? (args.abbreviation as string)
: await vscode.window.showInputBox({ prompt, validateInput: inputChanged });

const changesWereMade = await makeChanges(inputAbbreviation, false);
Expand Down Expand Up @@ -285,10 +285,10 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
}

args = args || {};
if (!args['language']) {
args['language'] = vscode.window.activeTextEditor.document.languageId;
if (!args.language) {
args.language = vscode.window.activeTextEditor.document.languageId;
} else {
const excludedLanguages = vscode.workspace.getConfiguration('emmet')['excludeLanguages'] ? vscode.workspace.getConfiguration('emmet')['excludeLanguages'] : [];
const excludedLanguages = vscode.workspace.getConfiguration('emmet').excludeLanguages ? vscode.workspace.getConfiguration('emmet').excludeLanguages : [];
if (excludedLanguages.includes(vscode.window.activeTextEditor.document.languageId)) {
return fallbackTab();
}
Expand All @@ -301,7 +301,7 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
const editor = vscode.window.activeTextEditor;

// When tabbed on a non empty selection, do not treat it as an emmet abbreviation, and fallback to tab instead
if (vscode.workspace.getConfiguration('emmet')['triggerExpansionOnTab'] === true && editor.selections.find(x => !x.isEmpty)) {
if (vscode.workspace.getConfiguration('emmet').triggerExpansionOnTab === true && editor.selections.find(x => !x.isEmpty)) {
return fallbackTab();
}

Expand Down Expand Up @@ -357,7 +357,7 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
return rootNode;
}

const usePartialParsing = vscode.workspace.getConfiguration('emmet')['optimizeStylesheetParsing'] === true;
const usePartialParsing = vscode.workspace.getConfiguration('emmet').optimizeStylesheetParsing === true;
if (editor.selections.length === 1 && isStyleSheet(editor.document.languageId) && usePartialParsing && editor.document.lineCount > 1000) {
rootNode = parsePartialStylesheet(editor.document, editor.selection.isReversed ? editor.selection.anchor : editor.selection.active);
} else {
Expand Down Expand Up @@ -418,7 +418,7 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
}

function fallbackTab(): Thenable<boolean | undefined> {
if (vscode.workspace.getConfiguration('emmet')['triggerExpansionOnTab'] === true) {
if (vscode.workspace.getConfiguration('emmet').triggerExpansionOnTab === true) {
return vscode.commands.executeCommand('tab');
}
return Promise.resolve(true);
Expand Down Expand Up @@ -670,7 +670,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
return line.replace(trimRegex, '').trim();
});
}
expandOptions['text'] = input.textToWrap;
expandOptions.text = input.textToWrap;

if (expandOptions.options) {
// Below fixes https://github.com/microsoft/vscode/issues/29898
Expand Down Expand Up @@ -701,9 +701,9 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {

export function getSyntaxFromArgs(args: { [x: string]: string }): string | undefined {
const mappedModes = getMappingForIncludedLanguages();
const language: string = args['language'];
const parentMode: string = args['parentMode'];
const excludedLanguages = vscode.workspace.getConfiguration('emmet')['excludeLanguages'] ? vscode.workspace.getConfiguration('emmet')['excludeLanguages'] : [];
const language: string = args.language;
const parentMode: string = args.parentMode;
const excludedLanguages = vscode.workspace.getConfiguration('emmet').excludeLanguages ? vscode.workspace.getConfiguration('emmet').excludeLanguages : [];
if (excludedLanguages.includes(language)) {
return;
}
Expand Down
10 changes: 5 additions & 5 deletions extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi

private provideCompletionItemsInternal(document: vscode.TextDocument, position: vscode.Position, context: vscode.CompletionContext): Thenable<vscode.CompletionList | undefined> | undefined {
const emmetConfig = vscode.workspace.getConfiguration('emmet');
const excludedLanguages = emmetConfig['excludeLanguages'] ? emmetConfig['excludeLanguages'] : [];
const excludedLanguages = emmetConfig.excludeLanguages ? emmetConfig.excludeLanguages : [];
if (excludedLanguages.includes(document.languageId)) {
return;
}
Expand All @@ -52,8 +52,8 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
const emmetMode = getEmmetMode((isSyntaxMapped ? mappedLanguages[document.languageId] : document.languageId), mappedLanguages, excludedLanguages);

if (!emmetMode
|| emmetConfig['showExpandedAbbreviation'] === 'never'
|| ((isSyntaxMapped || emmetMode === 'jsx') && emmetConfig['showExpandedAbbreviation'] !== 'always')) {
|| emmetConfig.showExpandedAbbreviation === 'never'
|| ((isSyntaxMapped || emmetMode === 'jsx') && emmetConfig.showExpandedAbbreviation !== 'always')) {
return;
}

Expand Down Expand Up @@ -135,7 +135,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
const offset = document.offsetAt(position);
if (isStyleSheet(document.languageId) && context.triggerKind !== vscode.CompletionTriggerKind.TriggerForIncompleteCompletions) {
validateLocation = true;
const usePartialParsing = vscode.workspace.getConfiguration('emmet')['optimizeStylesheetParsing'] === true;
const usePartialParsing = vscode.workspace.getConfiguration('emmet').optimizeStylesheetParsing === true;
rootNode = usePartialParsing && document.lineCount > 1000 ? parsePartialStylesheet(document, position) : <Stylesheet>getRootNode(document, true);
if (!rootNode) {
return;
Expand Down Expand Up @@ -200,7 +200,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
newItem.filterText = item.filterText;
newItem.sortText = item.sortText;

if (emmetConfig['showSuggestionsAsSnippets'] === true) {
if (emmetConfig.showSuggestionsAsSnippets === true) {
newItem.kind = vscode.CompletionItemKind.Snippet;
}
newItems.push(newItem);
Expand Down
2 changes: 1 addition & 1 deletion extensions/emmet/src/splitJoinTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function getRangesToReplace(document: vscode.TextDocument, nodeToUpdate: HtmlFla
const emmetMode = getEmmetMode(document.languageId, {}, []) ?? '';
const emmetConfig = getEmmetConfiguration(emmetMode);
if (emmetMode && emmetConfig.syntaxProfiles[emmetMode] &&
(emmetConfig.syntaxProfiles[emmetMode]['selfClosingStyle'] === 'xhtml' || emmetConfig.syntaxProfiles[emmetMode]['self_closing_tag'] === 'xhtml')) {
(emmetConfig.syntaxProfiles[emmetMode].selfClosingStyle === 'xhtml' || emmetConfig.syntaxProfiles[emmetMode].self_closing_tag === 'xhtml')) {
textToReplaceWith = ' ' + textToReplaceWith;
}
}
Expand Down
14 changes: 7 additions & 7 deletions extensions/emmet/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ export function sameNodes(node1: FlatNode | undefined, node2: FlatNode | undefin

export function getEmmetConfiguration(syntax: string) {
const emmetConfig = vscode.workspace.getConfiguration('emmet');
const syntaxProfiles = Object.assign({}, emmetConfig['syntaxProfiles'] || {});
const preferences = Object.assign({}, emmetConfig['preferences'] || {});
const syntaxProfiles = Object.assign({}, emmetConfig.syntaxProfiles || {});
const preferences = Object.assign({}, emmetConfig.preferences || {});
// jsx, xml and xsl syntaxes need to have self closing tags unless otherwise configured by user
if (syntax === 'jsx' || syntax === 'xml' || syntax === 'xsl') {
syntaxProfiles[syntax] = syntaxProfiles[syntax] || {};
Expand All @@ -624,12 +624,12 @@ export function getEmmetConfiguration(syntax: string) {

return {
preferences,
showExpandedAbbreviation: emmetConfig['showExpandedAbbreviation'],
showAbbreviationSuggestions: emmetConfig['showAbbreviationSuggestions'],
showExpandedAbbreviation: emmetConfig.showExpandedAbbreviation,
showAbbreviationSuggestions: emmetConfig.showAbbreviationSuggestions,
syntaxProfiles,
variables: emmetConfig['variables'],
excludeLanguages: emmetConfig['excludeLanguages'],
showSuggestionsAsSnippets: emmetConfig['showSuggestionsAsSnippets']
variables: emmetConfig.variables,
excludeLanguages: emmetConfig.excludeLanguages,
showSuggestionsAsSnippets: emmetConfig.showSuggestionsAsSnippets
};
}

Expand Down
10 changes: 5 additions & 5 deletions extensions/html-language-features/client/src/autoInsertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export function activateAutoInsertion(provider: (kind: 'autoQuote' | 'autoClose'
return;
}
const configurations = workspace.getConfiguration(undefined, document.uri);
isEnabled['autoQuote'] = configurations.get<boolean>('html.autoCreateQuotes') ?? false;
isEnabled['autoClose'] = configurations.get<boolean>('html.autoClosingTags') ?? false;
anyIsEnabled = isEnabled['autoQuote'] || isEnabled['autoClose'];
isEnabled.autoQuote = configurations.get<boolean>('html.autoCreateQuotes') ?? false;
isEnabled.autoClose = configurations.get<boolean>('html.autoClosingTags') ?? false;
anyIsEnabled = isEnabled.autoQuote || isEnabled.autoClose;
}

function onDidChangeTextDocument({ document, contentChanges, reason }: TextDocumentChangeEvent) {
Expand All @@ -58,9 +58,9 @@ export function activateAutoInsertion(provider: (kind: 'autoQuote' | 'autoClose'
const lastChange = contentChanges[contentChanges.length - 1];
if (lastChange.rangeLength === 0 && isSingleLine(lastChange.text)) {
const lastCharacter = lastChange.text[lastChange.text.length - 1];
if (isEnabled['autoQuote'] && lastCharacter === '=') {
if (isEnabled.autoQuote && lastCharacter === '=') {
doAutoInsert('autoQuote', document, lastChange);
} else if (isEnabled['autoClose'] && (lastCharacter === '>' || lastCharacter === '/')) {
} else if (isEnabled.autoClose && (lastCharacter === '>' || lastCharacter === '/')) {
doAutoInsert('autoClose', document, lastChange);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function activate(context: ExtensionContext) {


// pass the location of the localization bundle to the server
process.env['VSCODE_L10N_BUNDLE_LOCATION'] = l10n.uri?.toString() ?? '';
process.env.VSCODE_L10N_BUNDLE_LOCATION = l10n.uri?.toString() ?? '';

client = await startClient(context, newLanguageClient, { fileFs: getNodeFileFS(), TextDecoder, telemetry, timer });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ export function getLanguageModes(supportedLanguages: { [languageId: string]: boo
modelCaches.push(documentRegions);

let modes = Object.create(null);
modes['html'] = getHTMLMode(htmlLanguageService, workspace);
if (supportedLanguages['css']) {
modes['css'] = getCSSMode(cssLanguageService, documentRegions, workspace);
modes.html = getHTMLMode(htmlLanguageService, workspace);
if (supportedLanguages.css) {
modes.css = getCSSMode(cssLanguageService, documentRegions, workspace);
}
if (supportedLanguages['javascript']) {
modes['javascript'] = getJavaScriptMode(documentRegions, 'javascript', workspace);
modes['typescript'] = getJavaScriptMode(documentRegions, 'typescript', workspace);
if (supportedLanguages.javascript) {
modes.javascript = getJavaScriptMode(documentRegions, 'javascript', workspace);
modes.typescript = getJavaScriptMode(documentRegions, 'typescript', workspace);
}
return {
async updateDataProviders(dataProviders: IHTMLDataProvider[]): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as l10n from '@vscode/l10n';
async function setupMain() {
const l10nLog: string[] = [];

const i10lLocation = process.env['VSCODE_L10N_BUNDLE_LOCATION'];
const i10lLocation = process.env.VSCODE_L10N_BUNDLE_LOCATION;
if (i10lLocation) {
try {
await l10n.config({ uri: i10lLocation });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function activate(context: ExtensionContext) {
};

// pass the location of the localization bundle to the server
process.env['VSCODE_L10N_BUNDLE_LOCATION'] = l10n.uri?.toString() ?? '';
process.env.VSCODE_L10N_BUNDLE_LOCATION = l10n.uri?.toString() ?? '';

const schemaRequests = await getSchemaRequestService(context, logOutputChannel);

Expand Down Expand Up @@ -118,7 +118,7 @@ async function getSchemaRequestService(context: ExtensionContext, log: LogOutput

const response = await xhr({ url: uri, followRedirects: 5, headers });
if (cache) {
const etag = response.headers['etag'];
const etag = response.headers.etag;
if (typeof etag === 'string') {
log.trace(`[json schema cache] Storing schema ${uri} etag ${etag} in cache`);
await cache.putSchema(uri, etag, response.responseText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as l10n from '@vscode/l10n';
async function setupMain() {
const l10nLog: string[] = [];

const i10lLocation = process.env['VSCODE_L10N_BUNDLE_LOCATION'];
const i10lLocation = process.env.VSCODE_L10N_BUNDLE_LOCATION;
if (i10lLocation) {
try {
await l10n.config({ uri: i10lLocation });
Expand Down
2 changes: 1 addition & 1 deletion extensions/markdown-language-features/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function startServer(context: vscode.ExtensionContext, parser: IMdParser): Promi
};

// pass the location of the localization bundle to the server
process.env['VSCODE_L10N_BUNDLE_LOCATION'] = vscode.l10n.uri?.toString() ?? '';
process.env.VSCODE_L10N_BUNDLE_LOCATION = vscode.l10n.uri?.toString() ?? '';

return startClient((id, name, clientOptions) => {
return new LanguageClient(id, name, serverOptions, clientOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function resolveCopyDestinationSetting(documentUri: vscode.Uri, fileName: string
]);

return outDest.replaceAll(/(?<escape>\\\$)|(?<!\\)\$\{(?<name>\w+)(?:\/(?<pattern>(?:\\\/|[^\}\/])+)\/(?<replacement>(?:\\\/|[^\}\/])*)\/)?\}/g, (match, _escape, name, pattern, replacement, _offset, _str, groups) => {
if (groups?.['escape']) {
if (groups?.escape) {
return '$';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
export function resolveSnippet(snippetString: string, vars: ReadonlyMap<string, string>): string {
return snippetString.replaceAll(/(?<escape>\\\$)|(?<!\\)\$\{(?<name>\w+)(?:\/(?<pattern>(?:\\\/|[^\}])+?)\/(?<replacement>(?:\\\/|[^\}])+?)\/)?\}/g, (match, _escape, name, pattern, replacement, _offset, _str, groups) => {
if (groups?.['escape']) {
if (groups?.escape) {
return '$';
}

Expand Down
8 changes: 4 additions & 4 deletions extensions/markdown-language-features/src/markdownEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const pluginSourceMap: MarkdownIt.PluginSimple = (md): void => {
});

// The 'html_block' renderer doesn't respect `attrs`. We need to insert a marker.
const originalHtmlBlockRenderer = md.renderer.rules['html_block'];
const originalHtmlBlockRenderer = md.renderer.rules.html_block;
if (originalHtmlBlockRenderer) {
md.renderer.rules['html_block'] = (tokens, idx, options, env, self) => (
md.renderer.rules.html_block = (tokens, idx, options, env, self) => (
`<div ${self.renderAttrs(tokens[idx])} ></div>\n` +
originalHtmlBlockRenderer(tokens, idx, options, env, self)
);
Expand Down Expand Up @@ -261,8 +261,8 @@ export class MarkdownItEngine implements IMdParser {
}

#addFencedRenderer(md: MarkdownIt): void {
const original = md.renderer.rules['fenced'];
md.renderer.rules['fenced'] = (tokens: MarkdownIt.Token[], idx: number, options, env, self) => {
const original = md.renderer.rules.fenced;
md.renderer.rules.fenced = (tokens: MarkdownIt.Token[], idx: number, options, env, self) => {
const token = tokens[idx];
if (token.map?.length) {
token.attrJoin('class', 'hljs');
Expand Down
2 changes: 1 addition & 1 deletion extensions/merge-conflict/src/mergeDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class MergeDecorator implements vscode.Disposable {
outlineColor: new vscode.ThemeColor('merge.border')
});

this.decorations['splitter'] = vscode.window.createTextEditorDecorationType({
this.decorations.splitter = vscode.window.createTextEditorDecorationType({
color: new vscode.ThemeColor('editor.foreground'),
outlineStyle: 'solid',
outlineWidth: '1pt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class VSCodeTelemetryReporter implements TelemetryReporter {
"version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
properties['version'] = this.clientVersionDelegate();
properties.version = this.clientVersionDelegate();

reporter.postEventObj(eventName, properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ function generatePatchedEnv(env: any, modulePath: string, hasExecPath: boolean):
const newEnv = Object.assign({}, env);

if (!hasExecPath) {
newEnv['ELECTRON_RUN_AS_NODE'] = '1';
newEnv.ELECTRON_RUN_AS_NODE = '1';
}
newEnv['NODE_PATH'] = path.join(modulePath, '..', '..', '..');
newEnv.NODE_PATH = path.join(modulePath, '..', '..', '..');

// Ensure we always have a PATH set
newEnv['PATH'] = newEnv['PATH'] || process.env.PATH;
newEnv.PATH = newEnv.PATH || process.env.PATH;

return newEnv;
}
Expand Down
Loading
Loading