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

Language changes due to renames are not sufficiently recognized #12243

Open
core-ai-bot opened this issue Aug 31, 2021 · 12 comments
Open

Language changes due to renames are not sufficiently recognized #12243

core-ai-bot opened this issue Aug 31, 2021 · 12 comments

Comments

@core-ai-bot
Copy link
Member

Issue by DennisKehrig
Wednesday Feb 20, 2013 at 13:21 GMT
Originally opened as adobe/brackets#2911


For instance, when changing a file's extension from "txt" to "js", JSLint doesn't open. Only the editor mode is updated, but this is also only true for the current full editor.

Note that #2844 will introduce a "languageChanged" event that editors listen to in order to update their mode. JSLint and other tools could listen to the same event.

@core-ai-bot
Copy link
Member Author

Comment by DennisKehrig
Wednesday Feb 20, 2013 at 13:22 GMT


This is per@peterflynn's suggestion

@core-ai-bot
Copy link
Member Author

Comment by njx
Monday Feb 25, 2013 at 19:20 GMT


Marking move to backlog, to consider along with other rename issues (since rename isn't an "official" feature yet). Note that we will probably also want some other, more general event when a document is renamed, but it does make sense to specifically have a languageChanged event as well, since we've talked about allowing users to manually set the language of a document (e.g. if it doesn't have a file extension that we know about).

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Monday Feb 25, 2013 at 19:20 GMT


Trello lists this story.

@core-ai-bot
Copy link
Member Author

Comment by DennisKehrig
Wednesday Feb 27, 2013 at 11:01 GMT


@njx FileUtils.updateFileEntryPath now also triggers a rename event on NativeFileSystem.Entry

@core-ai-bot
Copy link
Member Author

Comment by DennisKehrig
Monday Mar 11, 2013 at 10:57 GMT


Said event was removed in #2961

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday May 21, 2013 at 21:35 GMT


Looks like this should be straightforward to fix now that we have the languageChanged event. We should also scrub everything in the app that gets the mode and make sure all those places properly update.

Marking medium priority to me.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Friday Oct 11, 2013 at 21:41 GMT


Seems this has been forgotten, but it's still a bug.

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Friday Oct 11, 2013 at 21:54 GMT


@peterflynn Hi Peter, please take a look at this and the pull request referenced above.
Thanks a ton.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Jan 08, 2014 at 09:23 GMT


I did the scrub NJ had suggested. Looks like there are at least a few items here:

  • Linting results need to update
  • In JavaScriptCodeHints, handleActiveEditorChange() needs to get rerun to install/remove listeners when a file changes to/from the JS language
  • Other aspects of JavaScriptCodeHints may need updating too (e.g. triggering a file to get read in by ScopeManager or ejected if it has previously been read in)
  • What does changing language mean for the state of a live development session? We might need to trigger a navigation if the current document is changed to HTML from something else. If the current document was HTML and is changed to something else, it's less clear what we would do -- would we close the live development session, or continue showing the now non-HTML file, or automatically navigate to a different file..?
  • The currently applicable custom view provider might need to change (though this couldn't be triggered by [CLOSED] navigate the sidebar with the keyboard #6409, which is only accessible in text viewers)

This is ignoring API usages by features that are highly transient (code hints, quick open) or that show a persistent results view but the results are static (HTML->CSS inline editor results list, JS inline editor results, CSS inline quick docs).

@core-ai-bot
Copy link
Member Author

Comment by njx
Saturday Jul 12, 2014 at 03:36 GMT


To@peterflynn. I didn't add a feature category - none of the existing ones seemed appropriate and I wasn't sure if we want one specifically for the language management stuff, since there probably aren't a huge number of issues there.

@core-ai-bot
Copy link
Member Author

Comment by busykai
Saturday Jul 12, 2014 at 15:21 GMT


@njx,@peterflynn I think this issue should be fixed as we merged #6409. All the language-related subsystem now should be reacting to the language changes (due to rename or forced).

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Jul 18, 2014 at 01:13 GMT


@busykai It definitely fixes the most important issues here... looking at the checklist above, there are still a bunch of much smaller edge cases that I don't think we addressed yet. They also seem not worth spending time on in the near term, unless we get feedback from users to the contrary :-) So I'd be in favor of keeping this open but at a lower priority.

(I'll change priority from medium->low now).

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

No branches or pull requests

1 participant