vscode-texinfo/src/extension.ts

51 lines
2.5 KiB
TypeScript
Raw Normal View History

2020-10-03 18:04:18 +00:00
/**
2020-10-24 21:45:32 +00:00
* extension.ts
2021-03-16 12:01:13 +00:00
*
* Copyright (C) 2020,2021 CismonX <admin@cismon.net>
*
* This file is part of vscode-texinfo.
*
* vscode-texinfo is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* vscode-texinfo is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with
* vscode-texinfo. If not, see <https://www.gnu.org/licenses/>.
2020-10-03 18:04:18 +00:00
*/
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';
import Indicator from './indicator';
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-25 18:14:13 +00:00
import PreviewContext from './contexts/preview';
2020-11-11 12:29:30 +00:00
import CodeLensProvider from './providers/code_lens';
2020-10-24 21:45:32 +00:00
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(
ContextMapping.instance, Diagnosis.instance, Indicator.instance, Logger.instance, Options.instance,
vscode.window.onDidChangeActiveTextEditor(Indicator.onTextEditorChange),
2020-10-24 21:45:32 +00:00
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-26 17:28:11 +00:00
vscode.commands.registerTextEditorCommand('texinfo.preview.show', PreviewContext.showPreview),
2020-11-11 12:29:30 +00:00
vscode.commands.registerCommand('texinfo.preview.goto', PreviewContext.gotoPreview),
vscode.commands.registerCommand('texinfo.indicator.click', Indicator.click),
2020-11-11 12:29:30 +00:00
vscode.languages.registerCodeLensProvider('texinfo', new CodeLensProvider()),
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
}