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

UpdateOpen is called with same file name for close and open differing only in case #82634

Closed
sheetalkamat opened this issue Oct 15, 2019 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded
Milestone

Comments

@sheetalkamat
Copy link
Member

sheetalkamat commented Oct 15, 2019

  • VSCode Version:
  • OS Version:
    Version: 1.40.0-insider (user setup)
    Commit: 3f6ed25
    Date: 2019-10-15T05:26:38.861Z
    Electron: 6.0.12
    Chrome: 76.0.3809.146
    Node.js: 12.4.0
    V8: 7.6.303.31-electron.0
    OS: Windows_NT x64 10.0.18363

Steps to Reproduce:
Found as part of microsoft/TypeScript#25460

  1. create a folder on case insensitive file system (eg windows)
  2. add files
// Logger.ts
export class logger { }
//another.ts
import { logger } from "./Logger";
new logger();
// tsconfig.json
{
  "compilerOptions": { "forceConsistentCasingInFileNames": true }
}
  1. code . in the folder
  2. Open Logger.ts and pin it in the editor
  3. rename Logger.ts to logger.ts
  4. Note in the tsserver log: (there shouldn't be exception) Note the UpdateOpen command is applied in sequence as all open files, changedFiles and then closed files so one cannot open and close same file with different casing in their name in same command on case insensitive file system
Info 69   [10:30:18.128] request:
    {"seq":5,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["c:/temp/est/Logger.ts"],"openFiles":[{"file":"c:/temp/est/logger.ts","fileContent":"export class logger {\r\n    \r\n}","scriptKindName":"TS","projectRootPath":"c:\\temp\\est"}]}}
Err 70    [10:30:18.153] Exception on executing command {"seq":5,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["c:/temp/est/Logger.ts"],"openFiles":[{"file":"c:/temp/est/logger.ts","fileContent":"export class logger {\r\n    \r\n}","scriptKindName":"TS","projectRootPath":"c:\\temp\\est"}]}}:

    Debug Failure. False expression: Script should not exist and not be open already

    Error: Debug Failure. False expression: Script should not exist and not be open already
        at ProjectService.applyChangesInOpenFiles (c:\Typescript\built\local\tsserver.js:138090:34)
        at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Typescript\built\local\tsserver.js:138972:46)
        at c:\Typescript\built\local\tsserver.js:140630:88
        at IOSession.Session.executeWithRequestId (c:\Typescript\built\local\tsserver.js:140621:28)
        at IOSession.Session.executeCommand (c:\Typescript\built\local\tsserver.js:140630:33)
        at IOSession.Session.onMessage (c:\Typescript\built\local\tsserver.js:140653:35)
        at Interface.<anonymous> (c:\Typescript\built\local\tsserver.js:141968:27)
        at Interface.emit (events.js:182:13)
        at Interface._onLine (readline.js:290:10)
        at Interface._normalWrite (readline.js:433:12)
        at Socket.ondata (readline.js:149:10)
        at Socket.emit (events.js:182:13)
        at addChunk (_stream_readable.js:283:12)
        at readableAddChunk (_stream_readable.js:264:11)
        at Socket.Readable.push (_stream_readable.js:219:10)
        at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz self-assigned this Oct 15, 2019
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues typescript Typescript support issues labels Oct 22, 2019
@mjbvz mjbvz added this to the October 2019 milestone Oct 25, 2019
@mjbvz mjbvz closed this as completed in ba4a504 Oct 25, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Oct 25, 2019

Good find and thanks for the repo steps. Should be fixed in tomorrow's insiders build

As a side note, we now automatically restart the ts server if there is a failure during updateOpen

@RMacfarlane RMacfarlane added the verified Verification succeeded label Oct 31, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants