This repository was archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Fixing issue #2923 - Getting mode from file extension won't always work #3029
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c040482
Fixing issue #2923 - Getting mode from file extension won't always work
MarkMurphy 6fee210
Fixing issue #2923 - Getting mode from file extension won't always work
MarkMurphy ea110a3
Merge branch 'markmurphy/issue-2923' of github.com:MarkMurphy/bracket…
MarkMurphy f9d9c2f
Refactoring "getLanguageFromFilePath" to "getLanguageFromPath". Rever…
MarkMurphy 30e9ca5
renamed "getLanguageFromPath" to "getLanguageForPath"
MarkMurphy 329aceb
Merge remote-tracking branch 'upstream/master' into markmurphy/issue-…
MarkMurphy 76ac3ff
Replacing references to getLanguageForFileExtension in Editor-test.js…
MarkMurphy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,4 +19,7 @@ src/extensions/disabled | |
|
|
||
| # unit test working directory | ||
| test/temp | ||
| test/results | ||
| test/results | ||
|
|
||
| # Netbeans | ||
| /nbproject | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need to do anything about this now, but it occurs to me that we don't have a good story for how an extension would offer improved support for these non-generic forms of XML. If the generic "xml" language has already claimed that file extension, no one can add a new language for it.
So for example, if I wanted to make an extension that offers offers tag & attribute hinting for SVG I'd ideally be able to un-register ".svg" from the "xml" language and declare a new "svg" language to take over it. (For code hinting specifically, you could do hacks to avoid defining a new language, but ultimately that approach will probably hit a wall).
This is relevant here since the more specific XML formats we add to our generic XML language, the more likely this is to become an issue. But as with my SVG example above, it's possible to hit this issue even on current master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. I wonder whether we'd want extensions to be able to simply add a file extension, and have them remove the file extension from some other language, or whether extensions have to prove some kind of awareness of the issue, like calling a special replaceFileExtension method somewhere, or having to provide a language from which they want to take a file extension, to indicate that this is a conscious specialization of a file extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Started a new issue around this. Lets move the discussion there: Issue #3044