Skip to content

Commit

Permalink
Renamed folders and fixed dropdown
Browse files Browse the repository at this point in the history
[release]
  • Loading branch information
madskristensen committed Jan 11, 2022
1 parent 8c245fa commit 872f43a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 23 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override bool OnSynchronizeDropdowns(LanguageService languageService, IVs
DropDownMember currentDropDown = dropDownMembers
.OfType<DropDownMember>()
.Where(d => d.Span.iStartLine <= line)
.LastOrDefault();
.LastOrDefault() ?? (DropDownMember)dropDownMembers[0];

selectedMember = dropDownMembers.IndexOf(currentDropDown);
selectedType = 0;
Expand Down
File renamed without changes.
12 changes: 2 additions & 10 deletions src/Language/MarkdownEditor.cs → src/Editor/LanguageFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ namespace MarkdownEditor2022
{
[ComVisible(true)]
[Guid(PackageGuids.EditorFactoryString)]
internal sealed class MarkdownEditor : LanguageBase
internal sealed class LanguageFactory : LanguageBase
{
private DropdownBars _dropdownBars;
private bool _disposed;

public MarkdownEditor(object site) : base(site)
public LanguageFactory(object site) : base(site)
{ }

public override string Name => Constants.LanguageName;
Expand Down Expand Up @@ -53,15 +52,8 @@ public override TypeAndMemberDropdownBars CreateDropDownHelper(IVsTextView textV

public override void Dispose()
{
if (_disposed)
{
return;
}

_disposed = true;
_dropdownBars?.Dispose();
_dropdownBars = null;

base.Dispose();
}
}
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/MarkdownEditor2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<Compile Include="DragDrop\MarkdownDropHandler.cs" />
<Compile Include="DragDrop\MarkdownDropHandlerProvider.cs" />
<Compile Include="ExtensionMethods.cs" />
<Compile Include="Language\EditorFeatures.cs" />
<Compile Include="Language\MarkdownEditor.cs" />
<Compile Include="Language\ClassificationTypes.cs" />
<Compile Include="Language\DropdownBars.cs" />
<Compile Include="Language\TokenTagger.cs" />
<Compile Include="Editor\EditorFeatures.cs" />
<Compile Include="Editor\LanguageFactory.cs" />
<Compile Include="Editor\ClassificationTypes.cs" />
<Compile Include="Editor\DropdownBars.cs" />
<Compile Include="Editor\TokenTagger.cs" />
<Compile Include="Margin\Browser.cs" />
<Compile Include="Margin\BrowserMargin.cs" />
<Compile Include="Margin\BrowserMarginProvider.cs" />
Expand Down
14 changes: 7 additions & 7 deletions src/MarkdownEditor2022Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ namespace MarkdownEditor2022
[ProvideMenuResource("Menus.ctmenu", 1)]
[Guid(PackageGuids.MarkdownEditor2022String)]

[ProvideLanguageService(typeof(MarkdownEditor), Constants.LanguageName, 0, ShowHotURLs = false, DefaultToNonHotURLs = true, EnableLineNumbers = true, EnableAsyncCompletion = true, ShowCompletion = true, ShowDropDownOptions = true)]
[ProvideLanguageService(typeof(LanguageFactory), Constants.LanguageName, 0, ShowHotURLs = false, DefaultToNonHotURLs = true, EnableLineNumbers = true, EnableAsyncCompletion = true, ShowCompletion = true, ShowDropDownOptions = true)]
[ProvideLanguageEditorOptionPage(typeof(OptionsProvider.AdvancedOptions), Constants.LanguageName, "", "Advanced", null, 0)]
[ProvideLanguageExtension(typeof(MarkdownEditor), Constants.FileExtension)]
[ProvideLanguageExtension(typeof(LanguageFactory), Constants.FileExtension)]

[ProvideEditorFactory(typeof(MarkdownEditor), 0, CommonPhysicalViewAttributes = (int)__VSPHYSICALVIEWATTRIBUTES.PVA_SupportsPreview, TrustLevel = __VSEDITORTRUSTLEVEL.ETL_AlwaysTrusted)]
[ProvideEditorLogicalView(typeof(MarkdownEditor), VSConstants.LOGVIEWID.TextView_string, IsTrusted = true)]
[ProvideEditorExtension(typeof(MarkdownEditor), Constants.FileExtension, 1000)]
[ProvideEditorFactory(typeof(LanguageFactory), 0, CommonPhysicalViewAttributes = (int)__VSPHYSICALVIEWATTRIBUTES.PVA_SupportsPreview, TrustLevel = __VSEDITORTRUSTLEVEL.ETL_AlwaysTrusted)]
[ProvideEditorLogicalView(typeof(LanguageFactory), VSConstants.LOGVIEWID.TextView_string, IsTrusted = true)]
[ProvideEditorExtension(typeof(LanguageFactory), Constants.FileExtension, 1000)]

[ProvideFileIcon(Constants.FileExtension, "KnownMonikers.RegistrationScript")]
public sealed class MarkdownEditor2022Package : ToolkitPackage
Expand All @@ -31,9 +31,9 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
{
await JoinableTaskFactory.SwitchToMainThreadAsync();

MarkdownEditor language = new(this);
LanguageFactory language = new(this);
RegisterEditorFactory(language);
((IServiceContainer)this).AddService(typeof(MarkdownEditor), language, true);
((IServiceContainer)this).AddService(typeof(LanguageFactory), language, true);

SetInternetExplorerRegistryKey();

Expand Down

0 comments on commit 872f43a

Please sign in to comment.