-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support autoCreateQuotes for pug
- Loading branch information
1 parent
c0bc95c
commit 9d6f5a8
Showing
3 changed files
with
43 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
packages/pug-language-service/src/services/quoteComplete.ts
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,19 @@ | ||
import type * as html from 'vscode-html-languageservice'; | ||
import type { PugDocument } from '../pugDocument'; | ||
|
||
export function register(htmlLs: html.LanguageService) { | ||
return (pugDoc: PugDocument, pos: html.Position, options?: html.CompletionConfiguration | undefined) => { | ||
|
||
const htmlRange = pugDoc.sourceMap.getMappedRange(pos)?.[0]; | ||
if (!htmlRange) return; | ||
|
||
const text = htmlLs.doQuoteComplete( | ||
pugDoc.htmlTextDocument, | ||
htmlRange.start, | ||
pugDoc.htmlDocument, | ||
options, | ||
); | ||
|
||
return text; | ||
}; | ||
} |
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