Adopt latest monaco-editor-core
parent
73295879a4
commit
7bd4d2543f
|
@ -24,7 +24,7 @@
|
|||
"gulp-uglify": "^1.5.3",
|
||||
"merge-stream": "^1.0.0",
|
||||
"mocha": "^2.5.3",
|
||||
"monaco-editor-core": "^0.3.1",
|
||||
"monaco-editor-core": "^0.4.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"typescript": "1.8.10",
|
||||
|
|
|
@ -464,7 +464,7 @@ outlineTypeTable[Kind.localFunction] = monaco.languages.SymbolKind.Function;
|
|||
// --- formatting ----
|
||||
|
||||
export abstract class FormatHelper extends Adapter {
|
||||
protected static _convertOptions(options: monaco.languages.IFormattingOptions): ts.FormatCodeOptions {
|
||||
protected static _convertOptions(options: monaco.languages.FormattingOptions): ts.FormatCodeOptions {
|
||||
return {
|
||||
ConvertTabsToSpaces: options.insertSpaces,
|
||||
TabSize: options.tabSize,
|
||||
|
@ -494,7 +494,7 @@ export abstract class FormatHelper extends Adapter {
|
|||
|
||||
export class FormatAdapter extends FormatHelper implements monaco.languages.DocumentRangeFormattingEditProvider {
|
||||
|
||||
provideDocumentRangeFormattingEdits(model: monaco.editor.IReadOnlyModel, range: Range, options: monaco.languages.IFormattingOptions, token: CancellationToken): Thenable<monaco.editor.ISingleEditOperation[]> {
|
||||
provideDocumentRangeFormattingEdits(model: monaco.editor.IReadOnlyModel, range: Range, options: monaco.languages.FormattingOptions, token: CancellationToken): Thenable<monaco.editor.ISingleEditOperation[]> {
|
||||
const resource = model.uri;
|
||||
|
||||
return wireCancellationToken(token, this._worker(resource).then(worker => {
|
||||
|
@ -516,7 +516,7 @@ export class FormatOnTypeAdapter extends FormatHelper implements monaco.language
|
|||
return [';', '}', '\n'];
|
||||
}
|
||||
|
||||
provideOnTypeFormattingEdits(model: monaco.editor.IReadOnlyModel, position: Position, ch: string, options: monaco.languages.IFormattingOptions, token: CancellationToken): Thenable<monaco.editor.ISingleEditOperation[]> {
|
||||
provideOnTypeFormattingEdits(model: monaco.editor.IReadOnlyModel, position: Position, ch: string, options: monaco.languages.FormattingOptions, token: CancellationToken): Thenable<monaco.editor.ISingleEditOperation[]> {
|
||||
const resource = model.uri;
|
||||
|
||||
return wireCancellationToken(token, this._worker(resource).then(worker => {
|
||||
|
|
|
@ -55,7 +55,7 @@ function setupMode(defaults:LanguageServiceDefaultsImpl, modeId:string, language
|
|||
disposables.push(monaco.languages.setTokensProvider(modeId, createTokenizationSupport(language)));
|
||||
}
|
||||
|
||||
const richEditConfiguration:monaco.languages.IRichLanguageConfiguration = {
|
||||
const richEditConfiguration:monaco.languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
|
||||
comments: {
|
||||
|
|
|
@ -122,6 +122,7 @@ const javascriptDefaults = new LanguageServiceDefaultsImpl(
|
|||
{ noSemanticValidation: true, noSyntaxValidation: false });
|
||||
|
||||
|
||||
// Export API
|
||||
function createAPI(): typeof monaco.languages.typescript {
|
||||
return {
|
||||
ModuleKind: ModuleKind,
|
||||
|
@ -133,6 +134,7 @@ function createAPI(): typeof monaco.languages.typescript {
|
|||
javascriptDefaults: javascriptDefaults
|
||||
}
|
||||
}
|
||||
monaco.languages.typescript = createAPI();
|
||||
|
||||
// --- Registration to monaco editor ---
|
||||
|
||||
|
|
|
@ -44,12 +44,12 @@ export class TypeScriptWorker implements ts.LanguageServiceHost {
|
|||
}
|
||||
|
||||
getScriptFileNames(): string[] {
|
||||
let models = monaco.worker.mirrorModels.map(model => model.uri.toString());
|
||||
let models = monaco.worker.getMirrorModels().map(model => model.uri.toString());
|
||||
return models.concat(Object.keys(this._extraLibs));
|
||||
}
|
||||
|
||||
private _getModel(fileName:string): monaco.worker.IMirrorModel {
|
||||
let models = monaco.worker.mirrorModels;
|
||||
let models = monaco.worker.getMirrorModels();
|
||||
for (let i = 0; i < models.length; i++) {
|
||||
if (models[i].uri.toString() === fileName) {
|
||||
return models[i];
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
"src/monaco.contribution.ts",
|
||||
"src/monaco.d.ts",
|
||||
"src/tokenization.ts",
|
||||
"src/typescript.ts",
|
||||
"src/worker.ts",
|
||||
"src/workerManager.ts",
|
||||
"test/assert.d.ts",
|
||||
|
|
Loading…
Reference in New Issue