You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently the tests in test/lib/service.spec.ts have a lot of verbose code (boilerplate, shallow namespace, magic numbers etc. ) that can be made much more readable with relatively little effort.
the concept not necessarily the perfect API):
const{fs, fsDriver}=makeTestFs();constfooDriver : {name,text,Document,positions}=fsDriver.addFile('foo.bar'/* fileName*/,editorText` |foo${1}bar |${2}biz${1}${2}baz`/* string | contentAndPositions */,'pseudocode'/* languageId */);fooDriver.positions.range(1)// returns the range between the two 1's from the templatefooDriver.positions.last(2)// returns the position of the last 2 from the template
where editorText removes pipe indentation, and computes positions (returns contentAndPositions).
Document is a result of TextDocumentItem.create(...)
name and text are the name and content of the file for easy reference down the test.
the test drivers themselves of course have to be tested. see test/testkit/text.spec.ts for example.
The text was updated successfully, but these errors were encountered:
another feature can be .getAllPositions(1 /* position key*/) which returns an array of LSP positions in that file, ready for command API (i.e definition request) [{ position: { line: x, character: y }, textDocument:{...} }, ...]
currently the tests in test/lib/service.spec.ts have a lot of verbose code (boilerplate, shallow namespace, magic numbers etc. ) that can be made much more readable with relatively little effort.
the concept not necessarily the perfect API):
where editorText removes pipe indentation, and computes positions (returns contentAndPositions).
Document is a result of TextDocumentItem.create(...)
name and text are the name and content of the file for easy reference down the test.
the test drivers themselves of course have to be tested. see test/testkit/text.spec.ts for example.
The text was updated successfully, but these errors were encountered: