-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #286 from afonsonf/enable-extension-in-the-web
Enable extension in browser environments
- Loading branch information
Showing
8 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
out/ | ||
node_modules/ | ||
.vscode-test/ | ||
.vscode-test-web/ | ||
version | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
import { CfgCompletionItemProvider } from './completions/cfgCompletions'; | ||
import { TlaCompletionItemProvider } from './completions/tlaCompletions'; | ||
import { TlaDeclarationsProvider, TlaDefinitionsProvider } from './declarations/tlaDeclarations'; | ||
import { CfgOnTypeFormattingEditProvider } from './formatters/cfg'; | ||
import { TlaOnTypeFormattingEditProvider } from './formatters/tla'; | ||
import { TlaDocumentInfos } from './model/documentInfo'; | ||
import { TlaDocumentSymbolsProvider } from './symbols/tlaSymbols'; | ||
|
||
const LANG_TLAPLUS = 'tlaplus'; | ||
const LANG_TLAPLUS_CFG = 'tlaplus_cfg'; | ||
const tlaDocInfos = new TlaDocumentInfos(); | ||
|
||
/** | ||
* Extension entry point. | ||
*/ | ||
export function activate(context: vscode.ExtensionContext): void { | ||
context.subscriptions.push( | ||
vscode.languages.registerOnTypeFormattingEditProvider( | ||
LANG_TLAPLUS, | ||
new TlaOnTypeFormattingEditProvider(), | ||
'\n', 'd', 'e', 'f', 'r'), | ||
vscode.languages.registerOnTypeFormattingEditProvider( | ||
LANG_TLAPLUS_CFG, | ||
new CfgOnTypeFormattingEditProvider(), | ||
'\n'), | ||
vscode.languages.registerDocumentSymbolProvider( | ||
LANG_TLAPLUS, | ||
new TlaDocumentSymbolsProvider(tlaDocInfos), | ||
{ label: 'TLA+' }), | ||
vscode.languages.registerCompletionItemProvider( | ||
LANG_TLAPLUS, | ||
new TlaCompletionItemProvider(tlaDocInfos)), | ||
vscode.languages.registerCompletionItemProvider( | ||
LANG_TLAPLUS_CFG, | ||
new CfgCompletionItemProvider()), | ||
vscode.languages.registerDeclarationProvider( | ||
LANG_TLAPLUS, | ||
new TlaDeclarationsProvider(tlaDocInfos)), | ||
vscode.languages.registerDefinitionProvider( | ||
LANG_TLAPLUS, | ||
new TlaDefinitionsProvider(tlaDocInfos) | ||
) | ||
); | ||
} |