-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: fix go to definition for copybook in shared drive (UNC) #2395
fix: fix go to definition for copybook in shared drive (UNC) #2395
Conversation
2e61f09
to
6308ceb
Compare
Is there an impact on processor groups (either library or program spec being UNC)? |
await helper.showDocument("TESTCPY1.cbl"); | ||
const progUri = await helper.getUri("TESTCPY1.cbl"); | ||
let editor = await helper.showDocument("TESTCPY1.cbl"); | ||
const progUri = editor.document.uri; |
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.
VsCode API has a different behavior for below 2 cases
vscode.languages.getDiagnostics(vscode.Uri.file("c:/Users/TESTCPY1.cbl"))
<-- SHOWS DIAGNOSTICS
vscode.languages.getDiagnostics(vscode.Uri.file("//./c:/Users/TESTCPY1.cbl"))
<-- NO DIAGNOSTICS
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.
I think the test is not opening the UNC path.
path.join(__dirname, "../../../../tests/test_files/project")
would need to be prefixed in the launchArgs
with \\.\
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.
I tried something in the same line here
I see paths being passed as file:///./c%3A/Users/che-che4z-lsp-for-cobol/tests/test_files/project/TESTCPY1.cbl
, when opening the document
if (process.platform === "win32") { | ||
console.log("----- RUNNING TEST USING UNC PATH ------"); | ||
options.extensionTestsEnv = { UNC_PREFIX: "\\." }; | ||
await runTests(options); |
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.
Is it ok to run the UNC tests like this? or handle it using custom mocha test runner or something in that line
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.
In general, I think this would be fine. But the UNC path needs to be passed to vscode e.g.
launchArgs[0] = "\\\\.\\" + launchArgs[0];
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.
Thanks! let me try that
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.
Found below issue while adding UNC tests -
- Java doesn't mind path like
\\<hostname>\cobolls-test
, but FAILS for path like\\.\c:\cobolls-test
Caused by: java.nio.file.InvalidPathException: Illegal character [:] in path at index 5: \\.\c:\cobolls-test
Also, there are a few bugs around UNC path JDK-8218618, which results in a failure at random places. For e.g. this bug resulted me in an error for UUID.randomUUID(
), as it internally relies on some nio packages.
So,
code \\.\c:\Users\testUsr\cobolls-test
<-- doesn't work
code \\HOSTNAME\Users\testUsr\cobolls-test
<-- works
But I guess, idea was to add support for copybook resolution in the shared drive. So, I plan to add a test for copybook resolution using UNC path. Do you think, its ok? please suggest
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.
Is it possible that you are running unpatched version of java? The issue, you linked, mentions two v11 versions that are supposed to be fixed.
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.
I was even able to read an NTFS alternate stream using UNC path e.g. \\.\c:\Source\test.txt:XYZ
This reverts commit c1a3cb65a55d99b8e66b1169b3bfa910fb6b39d0. test: Add UNC integration tests Signed-off-by: ap891843 <aman.prashant@broadcom.com> fix: fix go to definition for copybook in shared drive (UNC) fix go to definition for copybook in shared drive (UNC). VsCode is unable to resolve below unc path file:////<hostname>/Users/FILE , but can resolve file://<hostname>/Users/FILE Signed-off-by: ap891843 <aman.prashant@broadcom.com>
daadcea
to
3c99227
Compare
fix go to definition for copybook in shared drive (UNC).
Vs Code is unable to resolve below UNC path
file:////<hostname>/Users/FILE
,but can resolve
file://<hostname>/Users/FILE
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: