2020-10-03 18:04:18 +00:00
|
|
|
/**
|
2020-10-24 21:45:32 +00:00
|
|
|
* extension.ts
|
2020-10-03 18:04:18 +00:00
|
|
|
*
|
|
|
|
* @author CismonX <admin@cismon.net>
|
|
|
|
* @license MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
import * as vscode from 'vscode';
|
2020-10-24 21:45:32 +00:00
|
|
|
import ContextMapping from './context_mapping';
|
2020-10-24 15:51:44 +00:00
|
|
|
import Diagnosis from './diagnosis';
|
2020-10-22 22:37:47 +00:00
|
|
|
import Logger from './logger';
|
2020-10-14 19:22:32 +00:00
|
|
|
import Options from './options';
|
2020-10-24 21:45:32 +00:00
|
|
|
import PreviewContext from './context/preview';
|
|
|
|
import CompletionItemProvider from './providers/completion_item';
|
|
|
|
import DocumentSymbolProvider from './providers/document_symbol';
|
|
|
|
import FoldingRangeProvider from './providers/folding_range';
|
2020-10-03 18:04:18 +00:00
|
|
|
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
|
|
context.subscriptions.push(
|
2020-10-24 21:45:32 +00:00
|
|
|
ContextMapping.instance, Diagnosis.instance, Logger.instance, Options.instance,
|
|
|
|
vscode.workspace.onDidChangeTextDocument(ContextMapping.onDocumentUpdate),
|
|
|
|
vscode.workspace.onDidSaveTextDocument(ContextMapping.onDocumentSave),
|
|
|
|
vscode.workspace.onDidCloseTextDocument(ContextMapping.onDocumentClose),
|
2020-10-22 22:40:41 +00:00
|
|
|
vscode.workspace.onDidChangeConfiguration(Options.clear),
|
2020-10-24 21:45:32 +00:00
|
|
|
vscode.commands.registerTextEditorCommand('texinfo.showPreview', PreviewContext.showPreview),
|
2020-10-05 22:31:40 +00:00
|
|
|
vscode.languages.registerCompletionItemProvider('texinfo', new CompletionItemProvider(), '@'),
|
2020-10-20 20:12:33 +00:00
|
|
|
vscode.languages.registerDocumentSymbolProvider('texinfo', new DocumentSymbolProvider()),
|
2020-10-24 21:45:32 +00:00
|
|
|
vscode.languages.registerFoldingRangeProvider('texinfo', new FoldingRangeProvider()),
|
2020-10-05 22:31:40 +00:00
|
|
|
);
|
2020-10-03 18:04:18 +00:00
|
|
|
}
|