mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 19:08:21 +01:00
💄 code clean up in ld worker
This commit is contained in:
+11
-12
@@ -85,23 +85,22 @@ export class LanguageDetectionSimpleWorker extends EditorSimpleWorker {
|
||||
return;
|
||||
}
|
||||
|
||||
const content = this._getModel(uri);
|
||||
if (!content) {
|
||||
const model = this._getModel(uri);
|
||||
if (!model) {
|
||||
return;
|
||||
}
|
||||
|
||||
let modelResults: ModelResult[] | undefined;
|
||||
// Grab the first 10000 characters
|
||||
const end = model.positionAt(10000);
|
||||
const content = model.getValueInRange({
|
||||
startColumn: 1,
|
||||
startLineNumber: 1,
|
||||
endColumn: end.column,
|
||||
endLineNumber: end.lineNumber
|
||||
});
|
||||
try {
|
||||
// Grab the first 10000 characters
|
||||
const end = content.positionAt(10000);
|
||||
const range = content.getValueInRange({
|
||||
startColumn: 1,
|
||||
startLineNumber: 1,
|
||||
endColumn: end.column,
|
||||
endLineNumber: end.lineNumber
|
||||
});
|
||||
console.log(range);
|
||||
modelResults = await modelOperations.runModel(range);
|
||||
modelResults = await modelOperations.runModel(content);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user