Rename modeId -> languageId

This commit is contained in:
Alexandru Dima
2021-10-22 17:46:37 +02:00
parent 621f3bcc0b
commit d209aa2b02
34 changed files with 147 additions and 147 deletions

View File

@@ -1213,7 +1213,7 @@ export interface IModelAddedData {
versionId: number;
lines: string[];
EOL: string;
modeId: string;
languageId: string;
isDirty: boolean;
}
export interface ExtHostDocumentsShape {
@@ -2082,7 +2082,7 @@ export interface ExtHostNotebookKernelsShape {
}
export interface ExtHostInteractiveShape {
$willAddInteractiveDocument(uri: UriComponents, eol: string, modeId: string, notebookUri: UriComponents): void;
$willAddInteractiveDocument(uri: UriComponents, eol: string, languageId: string, notebookUri: UriComponents): void;
$willRemoveInteractiveDocument(uri: UriComponents, notebookUri: UriComponents): void;
}

View File

@@ -15,16 +15,16 @@ import type * as vscode from 'vscode';
import { equals } from 'vs/base/common/arrays';
const _modeId2WordDefinition = new Map<string, RegExp>();
export function setWordDefinitionFor(modeId: string, wordDefinition: RegExp | undefined): void {
export function setWordDefinitionFor(languageId: string, wordDefinition: RegExp | undefined): void {
if (!wordDefinition) {
_modeId2WordDefinition.delete(modeId);
_modeId2WordDefinition.delete(languageId);
} else {
_modeId2WordDefinition.set(modeId, wordDefinition);
_modeId2WordDefinition.set(languageId, wordDefinition);
}
}
export function getWordDefinitionFor(modeId: string): RegExp | undefined {
return _modeId2WordDefinition.get(modeId);
export function getWordDefinitionFor(languageId: string): RegExp | undefined {
return _modeId2WordDefinition.get(languageId);
}
export class ExtHostDocumentData extends MirrorTextModel {

View File

@@ -170,7 +170,7 @@ export class ExtHostDocuments implements ExtHostDocumentsShape {
}));
}
public setWordDefinitionFor(modeId: string, wordDefinition: RegExp | undefined): void {
setWordDefinitionFor(modeId, wordDefinition);
public setWordDefinitionFor(languageId: string, wordDefinition: RegExp | undefined): void {
setWordDefinitionFor(languageId, wordDefinition);
}
}

View File

@@ -103,7 +103,7 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
data.lines,
data.EOL,
data.versionId,
data.modeId,
data.languageId,
data.isDirty,
data.notebook
));

View File

@@ -38,12 +38,12 @@ export class ExtHostInteractive implements ExtHostInteractiveShape {
this._commands.registerApiCommand(openApiCommand);
}
$willAddInteractiveDocument(uri: UriComponents, eol: string, modeId: string, notebookUri: UriComponents) {
$willAddInteractiveDocument(uri: UriComponents, eol: string, languageId: string, notebookUri: UriComponents) {
this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({
addedDocuments: [{
EOL: eol,
lines: [''],
modeId: modeId,
languageId: languageId,
uri: uri,
isDirty: false,
versionId: 1,

View File

@@ -36,7 +36,7 @@ export class ExtHostCell {
return {
EOL: cell.eol,
lines: cell.source,
modeId: cell.language,
languageId: cell.language,
uri: cell.uri,
isDirty: false,
versionId: 1,