Skip to content

Commit

Permalink
Add test(s) that validate Pyright can talk over LSP (#7172)
Browse files Browse the repository at this point in the history
* Everything building, but not running

* More tests passing

* Fix test to open a file

* Remove unused functions and consolidate others

* Remove unused custom lsp messages

* Add comments
  • Loading branch information
rchiodo committed Feb 1, 2024
1 parent 7585378 commit e01b0fe
Show file tree
Hide file tree
Showing 13 changed files with 4,853 additions and 132 deletions.
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
"args": [
"${fileBasenameNoExtension}",
"--runInBand",
"--detectOpenHandles",
"--forceExit",
"--testTimeout=180000"
],
"cwd": "${workspaceRoot}/packages/pyright-internal",
"console": "integratedTerminal",
Expand All @@ -94,7 +97,7 @@
"name": "Pyright jest selected test",
"type": "node",
"request": "launch",
"args": ["${fileBasenameNoExtension}", "--runInBand", "-t", "${selectedText}"],
"args": ["${fileBasenameNoExtension}", "--runInBand", "-t", "${selectedText}", "--forceExit", "--testTimeout=180000"],
"cwd": "${workspaceRoot}/packages/pyright-internal",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
Expand Down
34 changes: 34 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,40 @@
}
}
}
},
{
"label": "Watch test server",
"type": "npm",
"script": "watch:testserver",
"isBackground": true,
// From vscode-tsl-problem-matcher.
"problemMatcher": {
"owner": "custom",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)",
"severity": 1,
"file": 2,
"line": 3,
"column": 4
},
{
"regexp": "\\s*TS(\\d+):\\s*(.*)$",
"code": 1,
"message": 2
}
],
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "PublicPath: .*?"
},
"endsPattern": {
"regexp": "webpack compiled in .*? ms"
}
}
}
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build:extension:dev": "cd packages/vscode-pyright && npm run webpack",
"build:cli:dev": "cd packages/pyright && npm run webpack",
"watch:extension": "cd packages/vscode-pyright && npm run webpack-dev",
"watch:testserver": "cd packages/pyright-internal && npm run webpack:testserver:watch",
"check": "npm run check:syncpack && npm run check:eslint && npm run check:prettier",
"check:syncpack": "syncpack list-mismatches",
"fix:syncpack": "syncpack fix-mismatches --indent \" \" && npm run install:all",
Expand Down
Loading

0 comments on commit e01b0fe

Please sign in to comment.