mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Move isTypeScriptDocument to languageModes
This commit is contained in:
parent
4e91c57764
commit
dc137ce28f
|
@ -7,8 +7,8 @@ import { workspace as Workspace, FormattingOptions, TextDocument, CancellationTo
|
|||
|
||||
import * as Proto from '../protocol';
|
||||
import { ITypeScriptServiceClient } from '../typescriptService';
|
||||
import * as languageIds from '../utils/languageModeIds';
|
||||
import API from '../utils/api';
|
||||
import { isTypeScriptDocument } from '../utils/languageModeIds';
|
||||
|
||||
function objsAreEqual<T>(a: T, b: T): boolean {
|
||||
let keys = Object.keys(a);
|
||||
|
@ -175,8 +175,4 @@ function getImportModuleSpecifierPreference(config: WorkspaceConfiguration) {
|
|||
case 'non-relative': return 'non-relative';
|
||||
default: return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function isTypeScriptDocument(document: TextDocument) {
|
||||
return document.languageId === languageIds.typescript || document.languageId === languageIds.typescriptreact;
|
||||
}
|
||||
}
|
|
@ -14,4 +14,8 @@ export const jsxTags = 'jsx-tags';
|
|||
|
||||
export function isSupportedLanguageMode(doc: vscode.TextDocument) {
|
||||
return vscode.languages.match([typescript, typescriptreact, javascript, javascriptreact], doc) > 0;
|
||||
}
|
||||
|
||||
export function isTypeScriptDocument(doc: vscode.TextDocument) {
|
||||
return vscode.languages.match([typescript, typescriptreact], doc) > 0;
|
||||
}
|
Loading…
Reference in a new issue