-
Notifications
You must be signed in to change notification settings - Fork 13
Add support for AsciiDoc #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ export function activate(context: vscode.ExtensionContext) { | |
context.subscriptions.push( | ||
vscode.languages.registerCompletionItemProvider(getDocSelector('markdown'), new DictionaryCompletionItemProvider("markdown")), | ||
vscode.languages.registerCompletionItemProvider(getDocSelector('latex'), new DictionaryCompletionItemProvider("latex")), | ||
vscode.languages.registerCompletionItemProvider(getDocSelector('asciidoc'), new DictionaryCompletionItemProvider("asciidoc")), | ||
vscode.languages.registerCompletionItemProvider(getDocSelector('html'), new DictionaryCompletionItemProvider("html")), | ||
vscode.languages.registerCompletionItemProvider(getDocSelector('todo'), new DictionaryCompletionItemProvider("markdown")) | ||
); | ||
|
@@ -214,6 +215,8 @@ class DictionaryCompletionItemProvider implements vscode.CompletionItemProvider | |
} | ||
|
||
switch (this.fileType) { | ||
case "asciidoc": | ||
return this.completeByFirstLetter(firstLetter, addSpace); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. But I guess there are some cases where we do not want a completion (e.g. urls). You can use regex101 (select ECMAScript in the left panel) to help you write those rules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, would need to test it more in that case. |
||
case "markdown": | ||
// [caption](don't complete here) | ||
if (/\[[^\]]*\]\([^\)]*$/.test(textBefore)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually do not update the version number in a feature commit. Just leave it to me and I will publish a new version after this PR is merged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, would leave it out, thanks.