-
Notifications
You must be signed in to change notification settings - Fork 4
Improve legacy MPQ diagnostics and preview error reporting #99
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
702ab66
Improve objmod tooltip previews
Frotty 7bd9de5
0.12.12
Frotty 612bd96
Improve MPQ diagnostics and error reporting
Frotty 9db4792
Address MPQ diagnostics review feedback
Frotty 97838d3
Preserve tooltip caret position
Frotty 83890fd
Polish startup errors and tooltip caret
Frotty b64887e
Refine tooltip caret mapping
Frotty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
| 'use strict'; | ||
|
|
||
| const assert = require('assert'); | ||
| const fs = require('fs'); | ||
| const os = require('os'); | ||
| const path = require('path'); | ||
| const ts = require('typescript'); | ||
|
|
||
| const root = path.resolve(__dirname, '..'); | ||
| const source = fs.readFileSync(path.join(root, 'src', 'features', 'diagnostics.ts'), 'utf8'); | ||
| const js = ts.transpileModule(source, { | ||
| compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, | ||
| }).outputText; | ||
| const mod = { exports: {} }; | ||
| new Function('exports', 'module', 'require', js)(mod.exports, mod, require); | ||
|
|
||
| const tempHome = fs.mkdtempSync(path.join(os.tmpdir(), 'wurst-diagnostics-')); | ||
| fs.mkdirSync(path.join(tempHome, 'logs')); | ||
| fs.writeFileSync( | ||
| path.join(tempHome, 'logs', 'languageServer.log'), | ||
| Array.from({ length: 125 }, (_, index) => `language-server-${index + 1}`).join('\n') | ||
| ); | ||
|
|
||
| mod.exports.appendDiagnostic('WC3 data', 'PKExplode: invalid literal size byte 40\n at explode (pkware.ts:42:7)'); | ||
| mod.exports.appendDiagnostic('MPQ', 'MPQ archive opened'); | ||
| mod.exports.appendDiagnostic('Inline icons', 'thumb generation failed'); | ||
| const report = mod.exports.buildDiagnosticsText(tempHome); | ||
|
|
||
| assert(report.includes('PKExplode: invalid literal size byte 40')); | ||
| assert(report.includes('at explode (pkware.ts:42:7)')); | ||
| assert(report.includes('MPQ archive opened')); | ||
| assert(report.includes('language-server-125')); | ||
| assert(!report.includes('language-server-25\n')); | ||
| assert(report.split('\n').filter((line) => line.includes('language-server-')).length === 100); | ||
| console.log('diagnostics tests passed (bounded tails and stack traces)'); |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do not exclude this resource from the VSIX while
loadCompilerKnowledgeBase()still uses it as the fallback when the installed compiler JAR is missing, busy, old, or lacks the knowledge-base entry. In a fresh/offline or standalone installation without usable WC3 game data, the packaged extension now returnsundefinedinstead of loading the bundled metadata, leaving object-editor fields and object references without their schemas, labels, and catalog data.Useful? React with 👍 / 👎.