Skip to content

IntelliSense Not working when using ramda #39398

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

Closed
ghost opened this issue Jul 1, 2020 · 19 comments
Closed

IntelliSense Not working when using ramda #39398

ghost opened this issue Jul 1, 2020 · 19 comments
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@ghost
Copy link

ghost commented Jul 1, 2020

Issue Type: Bug

Sudenly VsCode IntelliSense stop working. It gets freeze in "Loading..." when hover a js function or class on my Js files with my mouse. I'm working with react native. Only js no Typescript

I did nothing but write code.

I installed "JavaScript and TypeScript Nightly" extension but didn't work.

  • VsCode:
    Version: 1.46.1 (user setup)
    Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
    Date: 2020-06-17T21:13:20.174Z
    Electron: 7.3.1
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Windows_NT x64 10.0.18362

I repeat. I did nothing but write code.

@mjbvz
Copy link
Contributor

mjbvz commented Jul 1, 2020

Please try collecting the TS Server log:

  1. Set "typescript.tsserver.log": "verbose",
  2. Restart VS Code and reproduce the problem
  3. In VS Code, run the TypeScript: Open TS Server log command
  4. This should open a large log file called tsserver.log

If you can share the log, I can take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@ghost
Copy link
Author

ghost commented Jul 1, 2020

@mjbvz

Now I realize IntelliSense freezes after I save a file. I don't think is because my extensions because I was working with them time ago. The freezing lasts about 3 minutes and for some other functions doesn't work.

Here is the log:

tsserver.log

@mjbvz
Copy link
Contributor

mjbvz commented Jul 2, 2020

Thanks. Can you also test with all extensions disabled to make sure one is not causing this?

The only potential thing that stands out to me in the logs are a few long running requests:

Info 394  [17:23:9.589] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true Elapsed: 13547ms

Does intellisense resume if you wait a few seconds?

@ghost
Copy link
Author

ghost commented Jul 2, 2020

@mjbvz

I disabled all extensions and still the same if not worse, Intellisense just don't work on some functions and imports. I only enabled "JavaScript and TypeScript Nightly" but the same happened.

Now, I enabled all extensions again but it's worse now lol intellisense just dont work. Five minutes and nothing happens.

These are my logs without extension with an intellisense literally freezes.

tsserver.log

The problem is just on this react native project. I have other python, node, react native project and I don't have problem with them. Maybe it should be bacause ramda recursive functions on this particular project?

@ycjcl868
Copy link

ycjcl868 commented Jul 2, 2020

+1

@ghost
Copy link
Author

ghost commented Jul 2, 2020

@mjbvz

Okay, I found the bug but not the solution. And it was because of Ramda library.

Example to reproduce the bug.

Project directories:

  • index.js
  • function.js
// function.js

import R from 'ramda';

const remove = (a, b) => {
    {  . . .  } 
};

export { remove };

const curriedRemove = R.curry(remove);

export { curriedRemove };

// index.js

export * from './function'

For some reason, that will cause intellisense not to work.

If I remove the export line in index.js. intellisense will work (restarting vscode).

I think it's a vscode bug.

@mjbvz mjbvz transferred this issue from microsoft/vscode Jul 2, 2020
@mjbvz mjbvz removed their assignment Jul 2, 2020
@mjbvz mjbvz changed the title IntelliSense Not working IntelliSense Not working when using ramda Jul 2, 2020
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Jul 9, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.1 milestone Jul 9, 2020
@aecorredor
Copy link

aecorredor commented Jul 28, 2020

@BravenxX @mjbvz I had experienced the same exact problem with ramda's curry and had discussed it here: #39398 #38339. The strange thing is that @BravenxX is experiencing the same issue while only using JavaScript. I had initially thought it was a problem with recursive types in the @types/ramda library but from this it seems to be something specific with ramda then?

CC: @amcasey

@sandersn
Copy link
Member

Sounds like we should add this usage to our test suite.

Also @pirix-gh, might you be able to take a look at ramda's types to see why this happens?

@imcotton
Copy link
Contributor

Also @pirix-gh, might you be able to take a look at ramda's types to see why this happens?

I think he had changed user ID to @millsp

@millsp
Copy link
Contributor

millsp commented Jul 29, 2020

Sure, I'll take a look

@millsp
Copy link
Contributor

millsp commented Jul 30, 2020

It works well on my side, I could not reproduce the bug:

Screenshot from 2020-07-30 11-25-15

Version: 1.47.3
Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3e
Date: 2020-07-23T15:51:39.791Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 4.15.0-112-generic snap

@millsp
Copy link
Contributor

millsp commented Jul 30, 2020

@aecorredor would you mind linking the issue you had? (you mistakenly linked this same issue)

@aecorredor
Copy link

@millsp sorry about that, it's #38339

@millsp
Copy link
Contributor

millsp commented Jul 30, 2020

I'll be working during this year on more performant ways to write curry with overloads. In the meantime, if the actual Curry types cause problems, it should be reverted to what it used to be... But that will make some people scream! Or maybe [email protected] will help fix these perf issues since it introduces variadic tuple types #39094 (which are planned to be used in the upcoming ts-toolbelt@7.0.0). For info,this PR cut the type instantiation count by 60%.

Another thing that I could do is to try to further optimize Curry types, not sure if it's possible, though. I would need a repro that fails, I'm not able to reproduce the error at the moment. This would give me ground to work on optimizations... Thanks if someone can do this 👍

@millsp
Copy link
Contributor

millsp commented Jul 30, 2020

@aecorredor @BravenxX @imcotton can you please confirm that this is still happening? I recently pushed a series of lib-wide optimizations, maybe this could explain why I can't get the bug repro to work 🤔 Let me know.

@aecorredor
Copy link

@millsp for what package? TS, ramda, or @types/ramda?

@millsp
Copy link
Contributor

millsp commented Jul 30, 2020

@aecorredor for ts-toolbelt which provides the Curry types for ramda. Would you be so kind to test if the repro still fails or not?

@aecorredor
Copy link

@millsp I can confirm that the issue went away after upgrading ts-toolbelt to 6.13.36 🎉. Hopefully it goes away for good. Merci beaucoup 🤘🏻.

CC: @amcasey

@millsp
Copy link
Contributor

millsp commented Aug 4, 2020

@sandersn, I think that we can close this issue with #38339

@sandersn sandersn closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

7 participants