-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
TypeScript error reported in invalid filename (output parsing error?) #43664
Comments
Are you using tasks to build or watch your files? |
I think so - here's my https://github.com/Dart-Code/Dart-Code/blob/master/.vscode/tasks.json I also have the tslint extension installed. |
@DanTup the error message is from the TypeScript compiler. It looks like the What TypeScript version are you using?
Just curious what the ´wonky TSLint behaviour´ is, can you please file an issue about this in https://github.com/Microsoft/vscode-tslint/issues |
I'm on TS 2.7.1 (I think it's the latest, though I think I was seeing this just before I most recently upgraded). Relevant files here: https://github.com/Dart-Code/Dart-Code/blob/master/package.json The TSLint thing is ignored files randomly showing up in the problems window (opening/closing the file is enough to make them go away). I've opened https://github.com/Microsoft/vscode-tslint/issues/325. |
@DanTup this indeed looks like a problem with the matcher. For some reason it detects the end message of a the compile as a problem. If this happens again can you post the output of the terminal running the tsc compile here. It is the terminal containing the task you started. There must be something wrong with that output since the normal matching works for me. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@dbaeumer Happened again - here's the error shown in the terminal:
Here's how the output looks if I do
I've taken a copy of my working directory so hopefully can repro later if you need any more info than the above. |
Reopening. @DanTup does that happen always. Looks to me if the output of the |
Hmm, this looks ok?
Though looking back at the errors, I wonder if I copied my code after I'd already fixed an error, since the "half printed" error doesn't seem to be there. |
I might have bee slightly wrong about how often this happens; I've hit it 5 or 6 times this afternoon! :( |
I have no idea yet why this is happening. It is clear that the file name is incorrectly parsed from the output but I was not able to spot these in the output you provided. Which version of tsc are you using. I am asking since in 2.7.x tsc introduce escape sequences to clear the screen and may be this breaks something. Do you think this is something I could reproduce if you share your source code. |
@dbaeumer The project is https://github.com/Dart-Code/Dart-Code. I don't have source that reliably repros this, since it's usually only well after the error occurred that I noticed it, but it might show the versions etc. I think I have been on ts v2.7.2 for a while, so that sounds like a possibility. |
This is weird - I have a perfect repro of this... I can restart Code, open the folder, hit Ctrl+Shift+B and get a single error with this issue. However, I copied the folder, cleaned out Digging... |
Ok, maybe I have it! Do you have to do detection of when things wrapped? The only difference between the two folders I have mentioned above are the paths. I ran Of course it's the same except for the paths. The only thing I can guess, is that it's because the broken one ends one error on the last character of the line - so if you were trying to guess whether a line wrapped or not, maybe it's failing here? (If not, I'm out of ideas :)) |
Of course, since I posted this the issue has totally gone away again! (╯°□°)╯︵ ┻━┻) |
OK. I know why the second one breaks. It is because under Windows the terminal uses some magic to reconstruct lines in the terminal due to the lack of API under Windows. So the two error lines are folded into one hence making the problem detector fail. To fix this I need more cooperation from the terminal. @Tyriar what about I give you a hint in form of a regexp when to keep the next line separate even if the line before occupies the whole width? Alternatively we can give up on doing this in the terminal and the problem matcher does this. But I would need to know the width and I have no good understanding what would happen under Linux / Mac. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@dbaeumer This was closed by the bot because of the needs-more-info tag. |
@Tyriar different question: with the new terminal work for Windows will this problem go away? |
@dbaeumer microsoft/node-pty#216 is expected to improve this situation, but it may do the same thing as winpty in this regard and move the cursor to the next line instead of relying on the terminal. @zadjii-msft when a line is expected to wrap in conpty do you move the cursor down or rely on the terminal emulator to fix it, and therefore allow it to track full unwrapped lines? |
I believe I prototyped something like this for RS5, but it broke something else near the end of the release cycle and pulled it at the last minute. It was a little tricky to get exactly right without more test applications. So in RS5, we break text manually with a "\r\n". I'm happy to take another look at not manually breaking lines in this upcoming release. I've filed MSFT:19012792 on myself to investigate more :) |
@Tyriar moving the cursor is not an issue for me. The problem is that even though the program printed one line to stdout there is no reliable way right now to reconstruct that line. So just to be sure: in the future this will not be an issue anymore. |
@dbaeumer what I'm hearing from @zadjii-msft:
In RS5 it will still be an issue as the pty wraps text, xterm.js needs to receive the unwrapped text in order for it to know reliably where the wrapping points are. |
Just to add a few additional comments on this issue:
|
@dbaeumer what kind of Windows API would you need to dewrapping the lines correctly ? There is a way to detect the terminal width, according to https://gist.github.com/jtriley/1108174 |
@ncannasse this is not a width issue and not an issue with 80 characters. It is about the fact that if a line ends with a space in the terminal we don't know under Windows whether the next line belongs to it or not. With the current API we have to guess :-). We had a separate process before and this cases another big set of problems especially around ANSI escape sequences. So going back to this is not an option. To my knowledge you work on a language server. Why to do rely on tasks to produce the errors. You can always create diagnostics directly using the VS Code API? |
I'm not quite sure how that's related, a language server doesn't handle tasks / compilation. And as far as I know, VSCode currently doesn't have an API to "intercept" the execution of a task to allow for diagnostics-based problem reporting. |
@dbaeumer correct me if I'm wrong but diagnostics apply to currently opened files, whereas compilers can report issues in closed files. |
@ncannasse no, diagnostics are for both open and closed files. |
RE this:
It looks like the problem is that a line break that tsc is adding isn't staying added on Windows. Here it sounds like line breaks will be manually added with \r\n. If the line break intended by tsc is preserved, then the problem matcher should still work. @Tyriar, am I understanding this correctly? |
@alexr00 this comment gives some more details: Basically conpty and winpty will always sent |
I see, thank you. |
Hi, I also have the problem with the problemMatcher while using Clang-Tidy in our project. Will there be a fix in one of the nearer VSCode updates or can I fix it by my own? |
Here's the tracking issue for ConPTY that we need to get this fixed properly microsoft/terminal#405 |
There is nothing further we can action here so I'm closing it in favor of the upstream microsoft/terminal#405 which would fix the problem. |
I've seen this quite a lot these last few days; sometimes I get an error where the filename is completely messed up and if I click on the error in the problems window I then get an error that the file doesn't exist (with the path also being messed up - including parts of the error message inside the filename):
I'm not sure whether this is coming from built-in stuff or TSLint (since that seems to have some wonky behaviour) so I thought I'd start here and I can re-raise there if you think it's that.
The text was updated successfully, but these errors were encountered: