-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix VS Code not showing multi-line completions
- Loading branch information
Showing
4 changed files
with
283 additions
and
12 deletions.
There are no files selected for viewing
146 changes: 146 additions & 0 deletions
146
__snapshots__/packages/language-server/test-out/util/toLS.spec.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 @@ | ||
import * as core from '@spyglassmc/core' | ||
import { toLS } from '@spyglassmc/language-server/lib/util/index.js' | ||
import { describe, it } from 'mocha' | ||
import snapshot from 'snap-shot-it' | ||
import { TextDocument } from 'vscode-languageserver-textdocument' | ||
|
||
describe('toLS.completionItem()', () => { | ||
const doc = TextDocument.create( | ||
'spyglassmc:///test.mcfunction', | ||
'mcfunction', | ||
0, | ||
'adv\\\nan\\\nce', | ||
) | ||
const item = core.CompletionItem.create( | ||
'advancement', | ||
core.Range.create(0, 11), | ||
) | ||
it('Should map correctly when cursor is in first line', () => { | ||
snapshot(toLS.completionItem(item, doc, 1, true)) | ||
}) | ||
it('Should map correctly when cursor is in second line', () => { | ||
snapshot(toLS.completionItem(item, doc, 6, true)) | ||
}) | ||
it('Should map correctly when cursor is in third line', () => { | ||
snapshot(toLS.completionItem(item, doc, 10, true)) | ||
}) | ||
}) |
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