-
Notifications
You must be signed in to change notification settings - Fork 1k
[TextEditor] Allow extensions to opt file types into new editor #7872
Conversation
main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/SupportedFileTypeExtensionNode.cs
Outdated
Show resolved
Hide resolved
main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs
Outdated
Show resolved
Hide resolved
main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs
Outdated
Show resolved
Hide resolved
main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewDisplayBinding.cs
Outdated
Show resolved
Hide resolved
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.
👍
...ns/MonoDevelop.TextEditor/MonoDevelop.TextEditor/Properties/MonoDevelop.TextEditor.addin.xml
Show resolved
Hide resolved
FYI, the plan by 8.3 is for the new editor to blacklist types it cannot open (e.g. F#) instead of whitelist types it can. For 8.2 we will likely do this, and also blacklist web editor files until we light them up (because we will have TextMate support as generic fallback). |
6a98b60
to
59dda47
Compare
<Extension path="/MonoDevelop/TextEditor/SupportedFileTypes"> | ||
<SupportedFileType id="csharp" extensions=".cs,.csx" /> | ||
<SupportedFileType id="xaml" extensions=".xaml" FeatureSwitch="DesignersNewEditor" /> | ||
<SupportedFileType id="androidxaml" extensions=".xml,.axml" BuildAction="AndroidResource" FeatureSwitch="DesignersNewEditor" /> |
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.
Is this a typo? androidxaml
we already confuse people enough with the silly .axml
.
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.
yeah, stray a, will remove
@abock should we merge this in the meantime? I imagine it would still be useful as a mechanism to allow the blocklisted extensions (F#, generic XML, ASPX, MSBuild, .addin.xml, etc) to override the block smoothly when transitioning over. |
@mhutch yes, merge this and I will rebase textmate on this |
59dda47
to
103e7cf
Compare
103e7cf
to
ac6f40b
Compare
Failures look completely unrelated. Ok to merge? |
@slluis care to review? |
It looks good to me. |
} | ||
|
||
bool supported = false; | ||
var nodes = Mono.Addins.AddinManager.GetExtensionNodes<SupportedFileTypeExtensionNode> ("/MonoDevelop/TextEditor/SupportedFileTypes"); |
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.
Maybe we should cache this and listen to extension node change events? No use querying this every time.
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.
I don't think that's necessary, it's not particularly expensive. The main value of the event is to cache derived data, and we don't have any of that here.
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.
@mhutch thoughts? Looks like this does rebuild a list on each call.
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.
Batch opening docs will cause wasteful processing over here. Imo, switch to extension node events here.
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.
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.
Approved, added one more small improvement for caching extension nodes and listening for changes.
This adds a new extension point that extensions can use to opt individual file types into the new editor, optionally controlled by feature flags. This means that extensions can light up new file types in the new editor without changing the new editor itself.
ac6f40b
to
ba96038
Compare
Test failure is Xamarin.Forms timing out. Something about Java. |
This adds a new extension point that extensions can use to opt individual file types into the new editor, optionally controlled by feature flags.
This means that extensions can light up new file types in the new editor without changing the new editor itself.