Skip to content

Support debugging newly imported files#6776

Merged
rchiodo merged 4 commits into
masterfrom
rchiodo/debug_import
Jul 30, 2019
Merged

Support debugging newly imported files#6776
rchiodo merged 4 commits into
masterfrom
rchiodo/debug_import

Conversation

@rchiodo
Copy link
Copy Markdown

@rchiodo rchiodo commented Jul 30, 2019

For #6738

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Appropriate comments and documentation strings in the code
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • Test plan is updated as appropriate
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • The wiki is updated with any design decisions/details.

@rchiodo rchiodo self-assigned this Jul 30, 2019
public async debugCode(code: string, file: string, line: number, editor?: TextEditor): Promise<boolean> {
let saved = true;
// Make sure the file is saved before debugging
const doc = this.documentManager.textDocuments.find(d => d.fileName === file);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I usually use IFileSystem.arePathsSame for these types of comparisons. Probably not an issue, but I think that it's a bit safer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think I want case sensitive on Windows even.

// the new entry in the list
if (saved) {
const afterSave = [...this.documentManager.textDocuments];
const diff = afterSave.filter(f => beforeSave.indexOf(f) === -1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Filter creates a new array so you shouldn't need the spread operator copy above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's true. I'll change that.

Copy link
Copy Markdown
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

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

:shipit:

@rchiodo rchiodo merged commit 5471379 into master Jul 30, 2019
@rchiodo rchiodo deleted the rchiodo/debug_import branch July 30, 2019 23:00
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants