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

Adjust ALS .js.map files for debugging #1277

Merged
merged 11 commits into from
Apr 26, 2024
Merged

Conversation

TamiTakamiya
Copy link
Collaborator

When npm run compile copies ALS js/d.ts/js.map files from packages/ansible-language-server to out directory, we need to adjust the source path in .js.map files so that we can set breakpoints on TypeScript source files in debugging.

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TamiTakamiya Can we please find another way to address this issue? -- one that does not adds extra copy-files or replace-text-in-files?

With the tsconfig consolidated by #1279 it should be much easier to reconfigure how we compile to make it work "by default" and without any tricks.

PS. I would prefer to make use of out/ folder, so we do not spam our source tree.

@TamiTakamiya
Copy link
Collaborator Author

ci / test (macos) fails constantly with errors like

  ERROR in /Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts
  ./src/extension.ts 5:30-48
  [tsl] ERROR in /Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts(5,31)
        TS6059: File '/Users/runner/work/vscode-ansible/vscode-ansible/src/features/vault.ts' is not under 'rootDir' '/Users/runner/work/vscode-ansible/vscode-ansible/packages/ansible-language-server'. 'rootDir' is expected to contain all source files.
    The file is in the program because:
      Imported via "./features/vault" from file '/Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts'
      Root file specified for compilation
  task: Failed to run task "package": exit status 1
  ts-loader-default_02839d45964937a4

For some reasons, packaging on macos does not seem to work with the bundled js... I will take a look.

After rerunning the job, it succeeded. Let me run few more tests.

@TamiTakamiya
Copy link
Collaborator Author

ci / test (macos) fails constantly with errors like

  ERROR in /Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts
  ./src/extension.ts 5:30-48
  [tsl] ERROR in /Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts(5,31)
        TS6059: File '/Users/runner/work/vscode-ansible/vscode-ansible/src/features/vault.ts' is not under 'rootDir' '/Users/runner/work/vscode-ansible/vscode-ansible/packages/ansible-language-server'. 'rootDir' is expected to contain all source files.
    The file is in the program because:
      Imported via "./features/vault" from file '/Users/runner/work/vscode-ansible/vscode-ansible/src/extension.ts'
      Root file specified for compilation
  task: Failed to run task "package": exit status 1
  ts-loader-default_02839d45964937a4

For some reasons, packaging on macos does not seem to work with the bundled js... I will take a look.

After rerunning the job, it succeeded. Let me run few more tests.

I re-ran the test a couple of times, but could not recreate the issue. The log indicates there seem some timings that webpack set's its root dir to ALS's then attempts to compile extension's TypeScript code. Though I am going to merge this to main, I'll keep watching ci jobs if those issues re-appear.

@TamiTakamiya TamiTakamiya merged commit e511fef into main Apr 26, 2024
11 checks passed
@TamiTakamiya TamiTakamiya deleted the TamiTakamiya/fix-als-js-map branch April 26, 2024 19:17
goneri pushed a commit that referenced this pull request Apr 26, 2024
* Adjust ALS .js.map files for debugging

* Simply the script to deal with macos issue

* Redesign ALS source map support

* Fix test error and remove old "withserver" scripts

* test fix

---------

Co-authored-by: Sorin Sbarnea <[email protected]>
ssbarnea added a commit that referenced this pull request Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants