Skip to content
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

VSC extension never showing a result #224

Closed
maxime1992 opened this issue Aug 18, 2020 · 21 comments
Closed

VSC extension never showing a result #224

maxime1992 opened this issue Aug 18, 2020 · 21 comments

Comments

@maxime1992
Copy link
Contributor

I tried the extension after #210 got merged (I'm now on 3.0.2) and I never get a result when looking at Betterer output:

image

I tried to let that view opened for longer than it takes to run the Betterer command on the project and still nothing, I think it's stuck there (at least for the last 15mn).

Not sure how to help more than that on that one.

If you need any debug logs let me know how I can help 👍

@phenomnomnominal
Copy link
Owner

Ah, that's just not how the extension works 😄 . The output channel only has debug information. Any issues that betterer finds will show up in the "Problems" tab in VSCode:

Screen Shot 2020-08-18 at 8 32 31 PM

If that isn't working, then I can ship another version with more debugging to get a look at what's going on!

@maxime1992
Copy link
Contributor Author

I tried both 😅

Same issue.

I've got some output there but from another extension, nothing coming from Betterer

image

@phenomnomnominal
Copy link
Owner

phenomnomnominal commented Aug 18, 2020

Can you open a file that has issues in it in the .betterer.results file and see if that has any problems in it? They should be highlighted

@maxime1992
Copy link
Contributor Author

maxime1992 commented Aug 18, 2020

Oooooooooooh waiiiiiit it finally worked 😱

image

I wonder if there's any way to improve the perfs on that one by compiling only the closest project 🤔

We're working in a fairly large monorepo here and all the libs and apps are listed to go though Betterer.
It takes a solid +5mn to run every time which is a bit painful. If we were able to get some live reporting from the VSC extension in a fairly quick way that'd be super nice experience 😄

How does the ext works? Does it run Betterer with all the projects and then filter out the betterer.results file to only display the current one?

@phenomnomnominal
Copy link
Owner

The extension should only run the tests on the files as they change. But perhaps it's doing the whole application at the start or something? 🤔

@maxime1992
Copy link
Contributor Author

Could be yeah, I didn't stare and wait on the debug panel but I think it took at least 5/10mn before showing any result 🤔

@phenomnomnominal
Copy link
Owner

Okay, I'll try to push something with more logging. Any way you could run a perf trace on the normal betterer run? I'm guessing that it will be spending all it's time in the type checker.

@maxime1992
Copy link
Contributor Author

Any way you could run a perf trace on the normal betterer run?

Sure, can you provide some guidance? :)

@Svish
Copy link

Svish commented Oct 12, 2020

Same issue here, errors are just not showing up anywhere. It should be configured correctly, as I do get errors when I manually run npx betterer, but I get no squiggly lines in my editor, nor items in the Problems list.

I've had a file listed in .betterer.results with 4 errors open for several minutes, much longer than it takes to run betterer, and still nothing shows up. The Betterer "icon" in the status bar had a spinner for a short while, but doesn't seem like anything has been happening after "Betterer is running." 😕

@phenomnomnominal
Copy link
Owner

@Svish thanks for the details! I've got a branch in progress that should give me some actual debug output for the extension, so we can get a better idea of what's going on 😊

@tragetraje
Copy link

We're also having trouble using the VSCode extension. Apart from Betterer is running icon in the bottom right corner of the editor and output window, I don't get anything in the problems window neither I see the squiggly lines in the code highlighting the problems (There're more than 5000 lines of errors logged to the results file).
Any suggestion on what could I be doing wrong or is any additional setup required? Apart from that the package is great and would definitely help me to move towards stricter typing of my project. Thank you very much for that @phenomnomnominal!

@phenomnomnominal
Copy link
Owner

Sorry for the radio silence on this one! My branch from above is still in progress and I'm getting closer to actually shipping it. Hoping that will help me figure out what is going on.

@shian15810
Copy link
Contributor

shian15810 commented Mar 9, 2021

Hi @phenomnomnominal, would you push the branch that you are working on? I would like to help.

@phenomnomnominal
Copy link
Owner

@shian15810 Hey! Sorry for not updating the issue, the latest stuff is in master! If you want to check it out that would be amazing

@shian15810
Copy link
Contributor

Thanks @phenomnomnominal, will take a look.

Also thanks for this tool, it's a life saver!

@abrenneke
Copy link
Contributor

One thing is jumping out at me:

public report(document: TextDocument, summary: BettererSummary): void {
const filePath = getFilePath(document);
if (!filePath) {
return;
}
const diagnostics: Array<Diagnostic> = [];
const { runs } = summary;
const run = runs[runs.length - 1];
if (run.isFailed) {
return;
}
const result = run.result.value as BettererFileTestResult;
if (!result) {
return;
}
let issues: BettererFileIssues;
try {
issues = result.getIssues(filePath);
} catch {
return;
}

if your betterer file has more than one test, from what I can tell, the extension is only going to report the issues with the last one!

const run = runs[runs.length - 1];

@phenomnomnominal
Copy link
Owner

Just merged @abrenneke's fix and published a new version of the extension, which might be the fix needed here!

@abrenneke
Copy link
Contributor

Alright so things are definitely better(er) now, but there's a new problem - betterer is constantly clearing and redoing validation for documents.

It's also queuing validation for every single tsconfig.json file in our monorepo for... some reason, and that's totally clogging up the CPU runtime.

So, the result is that there are essentially no results showing in VS Code except for sometimes (when everything finally decides to settle down and display results for the file you're actually viewing).

It should definitely prioritize running betterer on the file you're currently viewing, if possible. I'll look into it running on the tsconfig files too if I get a chance, because those file aren't even open.

@phenomnomnominal
Copy link
Owner

@abrenneke I just published new versions of the lib and the extension with all the caching stuff enabled (as well as some queueing refactoring in the extension), so I hope it should be a bit better now! If you have a second to try it out that would be amazing! ☀️

@abrenneke
Copy link
Contributor

I'm getting results way faster in the extension now, and they don't disappear on save! Hugely improved, will let you know if they stop appearing for any reason ✌️ 🚀

@phenomnomnominal
Copy link
Owner

I'm gonna call this one done just cause I love closing issues. If it gets bad again, we'll open a new one!

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

No branches or pull requests

6 participants