Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix wrapper call to get project ghc version in windows and spaces in path #439

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

jneira
Copy link
Member

@jneira jneira commented Aug 16, 2021

@MuratOzsoyler hi, it would be great if you could try the beta version with this fix to see it works for you too. You have some notes on how to install manually the extension using a vsix field (this one haskell-1.6.1-beta.vsix.zip) here: #421 (comment)
thanks!

@MuratOzsoyler
Copy link

Sorry for the late answer. I can get back this issue a couple days later.

@MuratOzsoyler
Copy link

@jneira I've tested the new version.

In the first attempt the extension worked flawlessly.

But in the second attempt (loading another project) failed with this extension initialization messages:

[2021-08-20 13:41:07.790] [exthost] [error] [haskell.haskell] provider FAILED
[2021-08-20 13:41:07.810] [exthost] [error] TypeError: Cannot read property 'range' of undefined
    at H (c:\Users\zmtemp\.vscode-insiders\extensions\haskell.haskell-1.6.1\dist\extension.js:247:128228)
    at c:\Users\zmtemp\.vscode-insiders\extensions\haskell.haskell-1.6.1\dist\extension.js:247:133615
    at Array.map (<anonymous>)
    at Object.asSymbolInformations (c:\Users\zmtemp\.vscode-insiders\extensions\haskell.haskell-1.6.1\dist\extension.js:247:133608)
    at c:\Users\zmtemp\.vscode-insiders\extensions\haskell.haskell-1.6.1\dist\extension.js:1:48353
    at a.provideDocumentSymbols (c:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:162610)
[2021-08-20 13:42:02.619] [exthost] [info] extension host terminating: renderer closed the socket

When I load the first project everything works flawlessly again.

What do you want me to provide in order to track this error?

@jneira
Copy link
Member Author

jneira commented Aug 25, 2021

@jneira I've tested the new version.

In the first attempt the extension worked flawlessly.

But in the second attempt (loading another project) failed with this extension initialization messages:

What do you want me to provide in order to track this error?

Thank you so much for trying it. The first thing we need to do is determine if the second error (Cannot read property 'range') is also thrown by the actual version of the extenxion (1.6.0) to be able to do the relese of the fix for the first bug, triggered by a path with spaces.

@jneira
Copy link
Member Author

jneira commented Aug 25, 2021

The unique reference to range in the extension source code is:

try {
const hpackDoc = await vscode.workspace.openTextDocument(vscode.workspace.rootPath + '/package.yaml');
const hpack: any = yaml.safeLoad(hpackDoc.getText());
hpack.dependencies = hpack.dependencies || [];
if (!hpack.dependencies.some((dep: string) => new RegExp(escapeRegExp(arg.package)).test(dep))) {
hpack.dependencies.push(arg.package);
edit.replace(
hpackDoc.uri,
new vscode.Range(new vscode.Position(0, 0), hpackDoc.lineAt(hpackDoc.lineCount - 1).range.end),
yaml.safeDump(hpack)
);
}
} catch (e) {
// There is no package.yaml
}

And it is surrounded by a try with an empty catch (sic) so i am not sure if the error is related with the extension itself. Could we try the project in a vscode stable release (a link to the project would be useful too)?

@wclr
Copy link

wclr commented Aug 25, 2021

Hope to see this soon! Though for now have manually applied the fix.

@jneira
Copy link
Member Author

jneira commented Aug 25, 2021

ok will release the fix for paths with spaces asap, assuming the second error reported is not related with the fix itself (I don't see how could be related)

@jneira
Copy link
Member Author

jneira commented Aug 25, 2021

@MuratOzsoyler hi, the stacktrace has been reported here: #445. However it doesnt seem to block the loading of files so maybe you are experienced a different issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Couldn't figure out what GHC version the project is using' error on Windows 10
3 participants