Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Error With Async Linting when opening/reloading brackets with a preopen file #7459

Closed
fdecampredon opened this issue Apr 9, 2014 · 12 comments · Fixed by #9392
Closed

Error With Async Linting when opening/reloading brackets with a preopen file #7459

fdecampredon opened this issue Apr 9, 2014 · 12 comments · Fixed by #9392
Assignees

Comments

@fdecampredon
Copy link

I have created a typescript 'async' linter, If I open brackets with a typescript file open, the following error are output in my console :

Recursive tests with the same name are not supported. Timer name: CodeInspection:   /Users/kapit/Documents/workspaces/typescript/brackets-typescript/src/test/workingSetTest.ts PerfUtils.js:116
_markStart PerfUtils.js:116
Recursive tests with the same name are not supported. Timer name: CodeInspection 'TypeScript':  /Users/kapit/Documents/workspaces/typescript/brackets-typescript/src/test/workingSetTest.ts PerfUtils.js:116
_markStart
@peterflynn
Copy link
Member

This get logged when an async linting provider is invoked before its previous invocation on the same file has been finished. That seems to happen especially often when initially opening a project, because preferences change events tend to stack up and cause linting to get run twice in a row. But it could also happen e.g. by rapidly switching away from and then back to a specific file.

The warning is harmless, but we shouldn't spam the logs in cases like these where the provider is doing nothing wrong.

@peterflynn
Copy link
Member

CC @busykai

@busykai
Copy link
Contributor

busykai commented Apr 9, 2014

Yep. Actually the same thing happens each time a measurement is re-entered (e.g. opening a big file and quickly switching to another it would logged from file open). It's not specific to linting. I'll take a look at PerfUtils to see what can be done.

@peterflynn
Copy link
Member

Seems like there are at least these two options:

  • Add something to the string we pass PerfUtils so that each invocation is unique (simple spot fix)
  • Create a nicer PerfUtils API that returns a token that you use to stop the measurement, so that it doesn't have to rely on unique strings (more involved fix that could eventually benefit other code too)

@pthiess
Copy link
Contributor

pthiess commented Apr 13, 2014

marked needs review

@pthiess
Copy link
Contributor

pthiess commented Apr 14, 2014

Low priority - hey @busykai - please propose how to fix this and feel welcome to go ahead with this.

@peterflynn
Copy link
Member

@busykai Fwiw I don't think it happens with simple file-open flows, because the PerfUtils string is unique for each file path. The issue is only cases where two overlapping measurements have the same exact string, which is happening with linting.

@busykai
Copy link
Contributor

busykai commented Apr 14, 2014

@peterflynn you're right, it wouldn't happen if you switch once, but if you switch back it will. i'm not talking about regular use cases, but things like opening huge binary files in Brackets. at any rate, i think linting could well do the same as file open -- make a measurement specific to file, but it still needs a change in perfutils for a cleaner fix (especially if we want to tolerate service-based linters). to address that, i like your second option.

@peterflynn
Copy link
Member

Oh, another option I thought of a while back (albeit in a different context) -- create an API that ties a PerfUtils measurement directly to a Promise. This removes the need for a unique string as well, and should be less error-prone (and fewer lines of code) for clients of the API.

@FezVrasta
Copy link
Contributor

any news on this issue? I have the same errors in console and I don't know if I should do something or not..

Recursive tests with the same name are not supported. Timer name: CodeInspection 'less-autocompile':    D:/projectpath/custom.less 

@busykai
Copy link
Contributor

busykai commented Aug 27, 2014

Sorry, I was on a [probably too] long vacation will try to get to this ASAP.

busykai added a commit that referenced this issue Oct 1, 2014
Keep track of the measurements of the same name: assign them different ids, but
report them under the same name. All the measurements are now PerfMeasurement
objects.
redmunds added a commit that referenced this issue Nov 21, 2014
Fix #7459 -- allow parallel timers of the same name.
@redmunds
Copy link
Contributor

Confirmed. Closing.

@fdecampredon @FezVrasta This is fixed for Release 1.1

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

Successfully merging a pull request may close this issue.

6 participants