├── .editorconfig ├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── EditorExtensions ├── AppCache │ ├── Classify │ │ ├── AppCacheClassificationTypes.cs │ │ ├── AppCacheClassifier.cs │ │ └── AppCacheClassifierProvider.cs │ ├── Commands │ │ └── AppCacheCreationListener.cs │ └── ContentType │ │ └── AppCacheContentTypeDefinition.cs ├── BrowserLink │ ├── BestPractices │ │ ├── BestPracticesBrowserLink.cs │ │ ├── BestPracticesBrowserLink.js │ │ └── Rules │ │ │ ├── Description.cs │ │ │ ├── Favicon.cs │ │ │ ├── IRule.cs │ │ │ ├── Microdata.cs │ │ │ ├── RobotsTxt.cs │ │ │ ├── RulesFactory.cs │ │ │ └── Viewport.cs │ ├── BrowserInfo │ │ ├── BrowserInfo.cs │ │ └── BrowserInfo.js │ ├── DesignMode │ │ ├── DesignModeBrowserLink.cs │ │ └── DesignModeBrowserLink.js │ ├── InspectMode │ │ ├── InspectModeBrowserLink.cs │ │ └── InspectModeBrowserLink.js │ ├── Menu │ │ ├── MenuBrowserLink.cs │ │ └── MenuBrowserLink.js │ ├── PixelPushing │ │ ├── CssDeltaAction.cs │ │ ├── CssRuleBlockSyncAction.cs │ │ ├── CssRuleDefinitionSync.cs │ │ ├── CssSelectorChangeData.cs │ │ ├── CssSyncSuppressionContext.cs │ │ ├── PixelPushingMenu.cs │ │ ├── PixelPushingMode.cs │ │ ├── PixelPushingModeBrowserLink.js │ │ └── PixelPusingModeFactory.cs │ ├── UnusedCss │ │ ├── AmbientRuleContext.cs │ │ ├── CompositeUsageData.cs │ │ ├── CssDocument.cs │ │ ├── CssRule.cs │ │ ├── DocumentBase.cs │ │ ├── DocumentFactory.cs │ │ ├── ErrorList.cs │ │ ├── IDocument.cs │ │ ├── IResolutionRequiredDataSource.cs │ │ ├── IStylingRule.cs │ │ ├── IUsageDataSource.cs │ │ ├── LessDocument.cs │ │ ├── MessageDisplayManager.cs │ │ ├── MessageDisplaySource.cs │ │ ├── RawRuleUsage.cs │ │ ├── RuleExtensions.cs │ │ ├── RuleRegistry.cs │ │ ├── RuleUsage.cs │ │ ├── ScssDocument.cs │ │ ├── SessionResult.cs │ │ ├── SourceLocation.cs │ │ ├── UnusedCss.js │ │ ├── UnusedCssExtension.cs │ │ ├── UnusedCssExtensionFactory.cs │ │ ├── UnusedCssMenu.cs │ │ └── UsageRegistry.cs │ ├── UploadHelper.cs │ └── _intellisense │ │ ├── browserlink.intellisense.js │ │ ├── jquery-1.8.2.intellisense.js │ │ └── jquery-1.8.2.js ├── CSON │ └── ContentType │ │ └── CsonContentTypeDefinition.cs ├── CSS │ ├── Adornments │ │ ├── ColorAdornment.cs │ │ ├── ColorAdornmentTagger.cs │ │ ├── ColorAdornmentTaggerProvider.cs │ │ ├── ColorTag.cs │ │ ├── ColorTagger.cs │ │ ├── ColorTaggerProvider.cs │ │ └── IntraTextAdornmentTagger.cs │ ├── BrowserSelector │ │ ├── BrowserSchemaFilter.cs │ │ ├── BrowserSelector.xaml │ │ ├── BrowserSelector.xaml.cs │ │ └── BrowserStore.cs │ ├── Classify │ │ ├── Base64TaggerProvider.cs │ │ ├── CssHighlightWordTagger.cs │ │ ├── EmbeddedImageClassifier.cs │ │ ├── ImportantClassifier.cs │ │ ├── ValueTaggerProvider.cs │ │ ├── VariableClassifier.cs │ │ └── VendorClassifier.cs │ ├── Commands │ │ ├── ArrowsCommandTarget.cs │ │ ├── CssAddMissingStandardCommandTarget.cs │ │ ├── CssAddVendorStandardCommandTarget.cs │ │ ├── CssCreationListener.cs │ │ ├── CssFindReferencesCommandTarget.cs │ │ ├── CssRemoveDuplicatesCommandTarget.cs │ │ ├── CssSelectBrowsers.cs │ │ ├── F1HelpCommandTarget.cs │ │ └── RetriggerCommandTarget.cs │ ├── Completion │ │ ├── BrowserCompletionListEntry.cs │ │ ├── CompletionListEntry.cs │ │ ├── CompletionProviders │ │ │ ├── BrowserLinkCompletionProvider.cs │ │ │ ├── ColorCompletionProvider.cs │ │ │ ├── FontCompletionProvider.cs │ │ │ ├── MediaCompletionProvider.cs │ │ │ ├── MediaTypeCompletionProvider.cs │ │ │ ├── MediaValueCompletionProvider.cs │ │ │ ├── RegionCompletionProvider.cs │ │ │ └── VariableNameCompletionProvider.cs │ │ ├── ContextProviders │ │ │ ├── LessPseudoContextProvider.cs │ │ │ ├── MediaFeatureContextProvider.cs │ │ │ ├── MediaQueryContextProvider.cs │ │ │ └── VariableContextProvider.cs │ │ ├── Filter │ │ │ ├── HideInheritInitialCompletionListFilter.cs │ │ │ ├── HideUncommonCompletionListFilter.cs │ │ │ ├── ObsoleteCompletionListFilter.cs │ │ │ └── WebkitScrollbarCompletionListFilter.cs │ │ ├── FontFamilyCompletionListEntry.cs │ │ ├── IconProviders │ │ │ ├── BaseRegexCompletionEntryGlyphProvider.cs │ │ │ ├── FoundationCompletionEntryGlyphProvider.cs │ │ │ ├── GumbyCompletionEntryGlyphProvider.cs │ │ │ └── SkeletonCompletionEntryGlyphProvider.cs │ │ └── RegionCompletionListEntry.cs │ ├── DragDrop │ │ └── FontDrop.cs │ ├── MenuItems │ │ └── SolutionColors.cs │ ├── NavigateTo │ │ ├── CssGoToLineProvider.cs │ │ ├── CssGoToLineProviderFactory.cs │ │ └── CssGoToLineTag.cs │ ├── QuickInfo │ │ ├── Declaration │ │ │ ├── DeclarationQuickInfo.cs │ │ │ ├── DeclarationQuickInfoController.cs │ │ │ ├── DeclarationQuickInfoControllerProvider.cs │ │ │ └── DeclarationQuickInfoSourceProvider.cs │ │ ├── Font │ │ │ ├── FontQuickInfo.cs │ │ │ ├── FontQuickInfoController.cs │ │ │ ├── FontQuickInfoControllerProvider.cs │ │ │ └── FontQuickInfoSourceProvider.cs │ │ ├── Image │ │ │ ├── ImageQuickInfo.cs │ │ │ ├── ImageQuickInfoController.cs │ │ │ ├── ImageQuickInfoControllerProvider.cs │ │ │ └── ImageQuickInfoSourceProvider.cs │ │ ├── Selector │ │ │ ├── SelectorQuickInfo.cs │ │ │ ├── SelectorQuickInfoController.cs │ │ │ ├── SelectorQuickInfoControllerProvider.cs │ │ │ ├── SelectorQuickInfoSourceProvider.cs │ │ │ └── SelectorSpecificity.cs │ │ └── ValueOrder │ │ │ ├── RemoveCssSignatureHelpSource.cs │ │ │ ├── ValueOrderFactory.cs │ │ │ ├── ValueOrderSignature.cs │ │ │ ├── ValueOrderSignatureHelpSource.cs │ │ │ └── ValueOrderSignatureHelpSourceProvider.cs │ ├── Schemas │ │ ├── ColorPaletteProvider.cs │ │ ├── CssSchemaUpdater.cs │ │ ├── WE-Palette.css │ │ ├── XmlColorPaletteProvider.cs │ │ └── css-we-settings.xml │ ├── SmartTags │ │ ├── Actions │ │ │ ├── ColorConverterSmartTagAction.cs │ │ │ ├── EmbedSmartTagAction.cs │ │ │ ├── MissingStandardDirectiveSmartTagAction.cs │ │ │ ├── MissingStandardSmartTagAction.cs │ │ │ ├── OptimizeImageSmartTagAction.cs │ │ │ ├── RemoveCssRuleSmartTagAction.cs │ │ │ ├── RemoveSelectorHackSmartTagAction.cs │ │ │ ├── ReverseEmbedSmartTagAction.cs │ │ │ ├── SelectorHackSmartTagAction.cs │ │ │ ├── UpdateEmbedSmartTagAction.cs │ │ │ ├── VendorDirectiveSmartTagAction.cs │ │ │ ├── VendorOrderSmartTagAction.cs │ │ │ └── VendorSmartTagAction.cs │ │ ├── CssSmartTag.cs │ │ ├── CssSmartTagActionBase.cs │ │ ├── CssSmartTagProvider.cs │ │ ├── CssSmartTagger.cs │ │ ├── ICssSmartTagProvider.cs │ │ └── Providers │ │ │ ├── ColorConverterSmartTagProvider.cs │ │ │ ├── EmbedSmartTagProvider.cs │ │ │ ├── MissingStandardDirectiveSmartTagProvider.cs │ │ │ ├── MissingVendorDirectiveSmartTagProvider.cs │ │ │ ├── MissingVendorSmartTagProvider.cs │ │ │ ├── OptimizeImageSmartTagProvider.cs │ │ │ ├── RemoveCssRuleSmartTagProvider.cs │ │ │ ├── ReverseEmbedSmartTagProvider.cs │ │ │ ├── SelectorHackSmartTagProvider.cs │ │ │ ├── SortSmartTagProvider.cs │ │ │ ├── UpdateEmbedSmartTagProvider.cs │ │ │ └── VendorOrderSmartTagProvider.cs │ └── Validation │ │ ├── Filters │ │ ├── CustomCssErrorFilter.cs │ │ ├── ExtendCssErrorFilter.cs │ │ ├── MsFilterCssErrorFilter.cs │ │ ├── MsKeyframesCssErrorFilter.cs │ │ └── VariableCssErrorFilter.cs │ │ ├── Providers │ │ ├── ColorValuesInRangeErrorTagProvider.cs │ │ ├── DisplayInlineErrorTagProvider.cs │ │ ├── DuplicatePropertyErrorTagProvider.cs │ │ ├── DuplicateSelectorErrorTagProvider.cs │ │ ├── HoverOrderErrorTagProvider.cs │ │ ├── Ie10PrefixErrorTagProvider.cs │ │ ├── MediaQuerySyntaxErrorTagProvider.cs │ │ ├── MissingStandardDirectiveErrorTagProvider.cs │ │ ├── MissingVendorDirectiveErrorTagProvider.cs │ │ ├── MissingVendorErrorTagProvider.cs │ │ ├── ShorthandErrorTagProvider.cs │ │ ├── StarSelectorErrorTagProvider.cs │ │ ├── UnknownTagErrorTagProvider.cs │ │ ├── VendorOrderErrorTagProvider.cs │ │ └── ZeroUnitErrorTagProvider.cs │ │ ├── SelectorErrorTag.cs │ │ └── SimpleErrorTag.cs ├── CodeAnalysis.ruleset ├── CoffeeScript │ └── Commands │ │ └── CoffeeScriptCreationListener.cs ├── CommandConstants.cs ├── CompatibilityChecker.cs ├── CustomDictionary.xml ├── Dockerfile │ ├── Classify │ │ ├── DockerfileClassificationTypes.cs │ │ ├── DockerfileClassifier.cs │ │ └── DockerfileClassifierProvider.cs │ └── Completion │ │ ├── DockerfileCompletionController.cs │ │ └── DockerfileCompletionSource.cs ├── EditorExtensions.vsct ├── GlobalSuppressions.cs ├── HTML │ ├── Commands │ │ ├── ContractSelectionTarget.cs │ │ ├── EnterFormatCommandTarget.cs │ │ ├── ExpandSelectionTarget.cs │ │ ├── FindAllReferencesCommandTarget.cs │ │ ├── GoToDefinitionCommandTarget.cs │ │ ├── HtmlCreationListener.cs │ │ ├── RetriggerCommandTarget.cs │ │ └── ZenCodingCommandTarget.cs │ ├── Completion │ │ ├── AngularClassCompletion.cs │ │ ├── AngularLogoCompletion.cs │ │ ├── AppleLinkCompletion.cs │ │ ├── AppleMetaCompletion.cs │ │ ├── AriaIdCompletion.cs │ │ ├── AureliaCompletion.cs │ │ ├── Filters │ │ │ └── MsApplicationCompletion.cs │ │ ├── FragmentCompletion.cs │ │ ├── HtmlDataListCompletion.cs │ │ ├── HtmlLabelForAttributeCompletion.cs │ │ ├── InputIdAttributeCompletion.cs │ │ ├── MetaHttpEquivCompletion.cs │ │ ├── MiscMetaCompletion.cs │ │ ├── MsApplicationCompletion.cs │ │ ├── OpenGraphTypeCompletion.cs │ │ ├── SimpleHtmlCompletion.cs │ │ ├── StaticListCompletion.cs │ │ ├── TwitterCardCompletion.cs │ │ └── ViewportCompletion.cs │ ├── Helpers │ │ └── HtmlHelpers.cs │ ├── LightBulbs │ │ ├── Actions │ │ │ ├── AngularControllerLightBulbAction.cs │ │ │ ├── Base64DecodeLightBulbAction.cs │ │ │ ├── ExtractLightBulbAction.cs │ │ │ ├── HtmlSuggestedActionBase.cs │ │ │ ├── IntegrityLightBulbAction.cs │ │ │ ├── MinifyLightBulbAction.cs │ │ │ ├── OptimizeImageLightBulbAction.cs │ │ │ ├── RemoveElementLightBulbAction.cs │ │ │ └── SuggestedActionBase.cs │ │ ├── Providers │ │ │ ├── AngularControllerLightBulbProvider.cs │ │ │ ├── ImageLightBulbProvider.cs │ │ │ ├── IntegrityLightBulbProvider.cs │ │ │ ├── RemoveElementLightBulbProvider.cs │ │ │ └── StyleScriptLightBulbProvider.cs │ │ └── RemoteDownloaderSmartTag.cs │ ├── Outlining │ │ └── KoTagger.cs │ ├── Peek │ │ ├── ClassNames │ │ │ ├── ClassPeekDefinitionItem.cs │ │ │ ├── ClassPeekItemProvider.cs │ │ │ ├── ClassPeekItemSource.cs │ │ │ └── ClassPeekResultSource.cs │ │ └── IDs │ │ │ ├── IdPeekDefinitionItem.cs │ │ │ ├── IdPeekItemProvider.cs │ │ │ ├── IdPeekItemSource.cs │ │ │ └── IdPeekResultSource.cs │ ├── QuickInfo │ │ └── ImageHtml │ │ │ ├── ImageQuickInfo.cs │ │ │ ├── ImageQuickInfoController.cs │ │ │ ├── ImageQuickInfoControllerProvider.cs │ │ │ └── ImageQuickInfoSourceProvider.cs │ ├── Schema │ │ ├── DynamicSchemaFileProvider.cs │ │ ├── HtmlSchemaFileInfo.cs │ │ ├── IonicSchemaFileProvider.cs │ │ └── Schemas │ │ │ ├── aurelia.png │ │ │ └── aurelia.xsd │ └── Validation │ │ ├── BootstrapClassValidator.cs │ │ ├── BootstrapColumnsValidator.cs │ │ ├── FoundationClassValidator.cs │ │ ├── FoundationColumnsValidator.cs │ │ ├── ItemTypeValidator.cs │ │ ├── OpenGraphPrefixValidator.cs │ │ └── RelLogoValidator.cs ├── IcedCoffeeScript │ └── ContentType │ │ └── IcedCoffeeScriptContentTypeDefinition.cs ├── Images │ ├── Commands │ │ ├── PasteImageCommandTarget.cs │ │ └── WebEditorsCreationListener.cs │ ├── Compression │ │ ├── CompressionResult.cs │ │ └── ImageCompressor.cs │ └── MenuItems │ │ └── CompressImage.cs ├── JSON-LD │ ├── Completion │ │ ├── ContextCompletionProvider.cs │ │ ├── PropertyNameCompletionProvider.cs │ │ └── TypeCompletionProvider.cs │ ├── ContentType │ │ └── JsonLdContentTypeDefinition.cs │ └── Vocabularies │ │ ├── Helpers.cs │ │ ├── IVocabulary.cs │ │ ├── SchemaOrgVocabulary.cs │ │ └── VocabularyFactory.cs ├── JSON │ ├── Adornments │ │ ├── LogoAdornment.cs │ │ ├── LogoLayer.cs │ │ └── LogoProvider.cs │ ├── Commands │ │ ├── FormatCommandTarget.cs │ │ └── JsonCreationListener.cs │ ├── Completion │ │ ├── LicenseCompletionProvider.cs │ │ └── SimpleCompletionEntry.cs │ ├── Helpers │ │ └── JsonTreeVisitor.cs │ └── Resources │ │ ├── bower.png │ │ ├── grunt.png │ │ ├── gulp.png │ │ ├── npm.png │ │ └── vs.png ├── JavaScript │ ├── Classify │ │ ├── ES6Classifier.cs │ │ ├── ES6ClassifierProvider.cs │ │ ├── TaskClassificationTypes.cs │ │ ├── TaskClassifier.cs │ │ └── TaskClassifierProvider.cs │ ├── Commands │ │ ├── JavaScriptCreationListener.cs │ │ ├── JavaScriptFindReferencesCommandTarget.cs │ │ ├── NodeModuleGoToDefinition.cs │ │ └── ReferenceTagGoToDefinition.cs │ ├── Completion │ │ ├── GruntTaskCompletionSourceProvider.cs │ │ ├── HTML CompletionSources.cs │ │ ├── JavaScriptCompletionController.cs │ │ ├── JavaScriptCompletionSourceProvider.cs │ │ ├── JavaScriptIntellisense.cs │ │ ├── JsDocCompletionSource.cs │ │ ├── NodeModuleCompletionSourceProvider.cs │ │ ├── StringCompletionSource.cs │ │ └── UseDirectiveCompletionSource.cs │ ├── MenuItems │ │ ├── ReferenceJs.cs │ │ └── Unminify.cs │ ├── Outlining │ │ └── JavaScriptRegionTagger.cs │ ├── Resources │ │ └── Modern.Intellisense.js │ ├── Schemas │ │ └── FSPCache.cs │ └── Snippets │ │ ├── Web Essentials │ │ └── region.snippet │ │ └── snippets.pkgdef ├── LESS │ ├── Commands │ │ ├── LessCreationListener.cs │ │ ├── LessExtractMixinCommandTarget.cs │ │ └── LessExtractVariableCommandTarget.cs │ └── SmartTags │ │ ├── LessExtractVariableSmartTagAction.cs │ │ └── LessExtractVariableSmartTagProvider.cs ├── LiveScript │ └── ContentType │ │ └── LiveScriptContentTypeDefinition.cs ├── Markdown │ ├── Classify │ │ ├── BufferGenerator.cs │ │ ├── CodeArtifactProcessor.cs │ │ ├── CodeLanguageEmbedders.cs │ │ ├── MarkdownClassificationTypes.cs │ │ ├── MarkdownClassifier.cs │ │ ├── MarkdownParser.cs │ │ ├── RoslynEmbedder.cs │ │ └── Sample.md │ ├── Completion │ │ ├── MarkdownCompletionFilter.cs │ │ └── MarkdownCreationListener.cs │ ├── ContentType │ │ ├── MarkdownContentTypeDefinition.cs │ │ └── MarkdownContentTypeHandler.cs │ ├── DragDrop │ │ └── MarkdownImageDrop.cs │ ├── Margin │ │ ├── MarkdownMargin.cs │ │ ├── highlight.css │ │ └── highlight.js │ ├── MenuItems │ │ └── Markdown.cs │ └── Outlining │ │ └── MarkdownOutlineTagger.cs ├── Misc │ ├── CodeGeneration │ │ ├── IntellisenseObject.cs │ │ ├── IntellisenseParser.cs │ │ ├── IntellisenseProperty.cs │ │ ├── IntellisenseType.cs │ │ ├── IntellisenseWriter.cs │ │ └── ScriptIntellisenseListener.cs │ ├── MenuItems │ │ ├── AddIntellisenseFile.cs │ │ ├── Diff.cs │ │ ├── ProjectSettings.cs │ │ └── Transform.cs │ └── Minification │ │ └── IFileMinifier.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources │ ├── Images │ │ ├── Browser Pause Button.png │ │ ├── Browser Record Button.png │ │ ├── Browsers │ │ │ ├── c.png │ │ │ ├── c_gray.png │ │ │ ├── e.png │ │ │ ├── ff.png │ │ │ ├── ff_gray.png │ │ │ ├── ie.png │ │ │ ├── ie_gray.png │ │ │ ├── o.png │ │ │ ├── o_gray.png │ │ │ ├── s.png │ │ │ └── s_gray.png │ │ ├── Images.png │ │ ├── MenuImages.png │ │ ├── WebEssentials2012logo.png │ │ ├── angular.png │ │ ├── aurelia.png │ │ ├── blueprint.png │ │ ├── bootstrap.png │ │ ├── browserlink.png │ │ ├── delete.png │ │ ├── embed.png │ │ ├── extract.png │ │ ├── foundation.png │ │ ├── gumby.png │ │ ├── jsfile.png │ │ ├── no_skull.png │ │ ├── node_module.png │ │ ├── nopreview.png │ │ ├── numbers.png │ │ ├── palette.png │ │ ├── preview.png │ │ ├── skeleton.png │ │ ├── skull.png │ │ └── warning.png │ ├── Scripts │ │ └── AngularController.js │ └── Tools │ │ ├── gifsicle.exe │ │ ├── jpegtran.exe │ │ ├── optipng.exe │ │ ├── png.cmd │ │ └── pngout.exe ├── RobotsTxt │ ├── Classify │ │ ├── RobotsTxtClassificationTypes.cs │ │ ├── RobotsTxtClassifier.cs │ │ └── RobotsTxtClassifierProvider.cs │ └── Completion │ │ ├── RobotsCompletionController.cs │ │ └── RobotsCompletionSource.cs ├── SCSS │ ├── Commands │ │ ├── ScssCreationListener.cs │ │ ├── ScssExtractMixinCommandTarget.cs │ │ └── ScssExtractVariableCommandTarget.cs │ └── SmartTags │ │ └── ScssExtractVariableSmartTagProvider.cs ├── Settings │ ├── OptionPages.cs │ ├── ProjectSettingsTextViewListener.cs │ ├── SettingsStore.cs │ └── WESettings.cs ├── Shared │ ├── Commands │ │ ├── CommandExceptionFilter.cs │ │ ├── CommandTargetBase.cs │ │ ├── CommentCommandTarget.cs │ │ ├── CommentCompletionCommandTarget.cs │ │ ├── CommentIndentationCommandTarget.cs │ │ ├── EncodeSelectionCommandTarget.cs │ │ ├── EnterIndentationCommandTarget.cs │ │ ├── ExtractToFileCommandTarget.cs │ │ ├── IFileSaveListener.cs │ │ ├── MinifySelectionCommandTarget.cs │ │ ├── RemoveDuplicateLinesCommandTarget.cs │ │ ├── RemoveEmptyLinesCommandTarget.cs │ │ ├── SortSelectedLinesCommandTarget.cs │ │ └── TextCreationListener.cs │ ├── Compilers │ │ ├── Compilation Interfaces.cs │ │ ├── CompilerNotifierProviders.cs │ │ ├── CompilerRunner.cs │ │ ├── EditorCompilerInvoker.cs │ │ └── Result │ │ │ ├── CompilerError.cs │ │ │ ├── CompilerResult.cs │ │ │ ├── CompilerResultFactory.cs │ │ │ └── CssCompilerResult.cs │ ├── ExtensionMethods │ │ ├── AtDirectiveExtensions.cs │ │ ├── ColorModelExtensions.cs │ │ ├── CssExtensions.cs │ │ ├── DeclarationExtensions.cs │ │ ├── DispatcherPriorityAwaitable.cs │ │ ├── DispatcherPriorityAwaiter.cs │ │ ├── Extensions.cs │ │ ├── HtmlExtensions.cs │ │ ├── IVsExtensions.cs │ │ └── TaskExtensions.cs │ ├── Helpers │ │ ├── AsyncLock.cs │ │ ├── Base64VLQ.cs │ │ ├── Css │ │ │ ├── CssItemAggregator.cs │ │ │ ├── CssItemCollector.cs │ │ │ ├── CssTreeWatcher.cs │ │ │ ├── CssUrlNormalizer.cs │ │ │ ├── StyleSheetHelpers.cs │ │ │ └── VendorHelpers.cs │ │ ├── CssSourceMap.cs │ │ ├── DependencyGraph.cs │ │ ├── Disposable.cs │ │ ├── FileCache.cs │ │ ├── FileHelpers.cs │ │ ├── ImageHelper.cs │ │ ├── Logger.cs │ │ ├── Mef.cs │ │ ├── NodeModuleService.cs │ │ ├── OptionHelpers.cs │ │ ├── Policies │ │ │ ├── PolicyFactory.cs │ │ │ └── Strategies │ │ │ │ └── FileTransientErrorDetectionStrategy.cs │ │ ├── ProjectHelpers.cs │ │ ├── SourceMapNode.cs │ │ ├── TabAwareCharacterStream.cs │ │ ├── Telemetry.cs │ │ └── WindowHelpers.cs │ └── Margins │ │ ├── CssTextViewMargin.cs │ │ ├── EditorMarginFactory.cs │ │ ├── MarginBase.cs │ │ └── TextViewMargin.cs ├── Source.extension.cs ├── Source.extension.ico ├── Source.extension.resx ├── Source.extension.vsixmanifest ├── Svg │ ├── ContentType │ │ └── SvgContentTypeDefinition.cs │ └── Margin │ │ └── SvgMargin.cs ├── SweetJs │ ├── Commands │ │ └── SweetJsCreationListener.cs │ └── ContentType │ │ └── SweetJsContentTypeDefinition.cs ├── WebEssentials2015.csproj ├── WebEssentials2015.ncrunchproject ├── WebEssentials2015.v2.ncrunchproject ├── WebEssentialsPackage.cs ├── WebVtt │ ├── Classify │ │ ├── WebVttClassificationTypes.cs │ │ ├── WebVttClassifier.cs │ │ └── WebVttClassifierProvider.cs │ ├── Commands │ │ └── WebVttCreationListener.cs │ └── ContentType │ │ └── WebVttContentTypeDefinition.cs ├── app.config ├── packages.config └── registry.pkgdef ├── LICENSE.txt ├── README.md ├── Rebracer.xml ├── WebEssentials2012logo.pdn ├── WebEssentials2015.sln ├── WebEssentialsTests.UnitTests.testsettings ├── WebEssentialsTests ├── Extensions.cs ├── ExtractZipTask.cs ├── IntegrationTests │ ├── Compilation │ │ └── CompileOnSaveTests.cs │ ├── Completion │ │ ├── CommentsTest.cs │ │ ├── JsIntelliSenseTest.cs │ │ └── ZenCodingTest.cs │ ├── Dependencies │ │ ├── ChainCompilationTests.cs │ │ └── DependencyGraphTests.cs │ ├── ProjectHelpersTests.cs │ └── SettingsTests.cs ├── Properties │ └── AssemblyInfo.cs ├── TestCodeExtensions.cs ├── Tests │ ├── BootStrap │ │ ├── BootStrapValidationTests.cs │ │ └── BootstrapColumnsValidatorTests.cs │ ├── Foundation │ │ ├── FoundationColumnsValidatorTests.cs │ │ └── FoundationValidationTests.cs │ ├── Handlebars │ │ └── HandlebarsCompilationTests.cs │ ├── IntellisenseGeneration │ │ ├── IntellisenseTypeTests.cs │ │ ├── IntellisenseWriteJavaScriptsTests.cs │ │ ├── IntellisenseWriteTypeScriptTests.cs │ │ ├── Parsing_CollectionModel_Tests.cs │ │ ├── Parsing_SimpleClass_Tests.cs │ │ ├── Parsing_SimpleNullable_Tests.cs │ │ └── TestHelper │ │ │ ├── IntellisenseObjectsAssertions.cs │ │ │ ├── IntellisenseObjectsAssertionsExtensions.cs │ │ │ └── IntellisensePropertyAssertions.cs │ ├── LESS │ │ └── LessDocumentTests.cs │ ├── Markdown │ │ ├── MarkdownClassifierTests.cs │ │ ├── MarkdownCodeBlockTests.cs │ │ ├── MarkdownOutlinerTests.cs │ │ └── TabAwareCharacterStreamTests.cs │ ├── NodeExecutors │ │ ├── CoffeeScriptCompilationTests.cs │ │ ├── IcedCoffeeScriptCompilationTests.cs │ │ ├── JsHintTests.cs │ │ ├── LessCompilationTests.cs │ │ ├── ScssCompilationTests.cs │ │ └── SweetJsCompilationTests.cs │ ├── NodeModules │ │ ├── NodeModuleCompletionTests.cs │ │ └── NodeModuleImportedTests.cs │ ├── Scss │ │ └── ScssDocumentTests.cs │ └── Shared │ │ ├── Base64VLQ.cs │ │ └── MockSnapshot.cs ├── VSHost.cs ├── WebEssentialsTests.csproj ├── WebEssentialsTests.ncrunchproject ├── WebEssentialsTests.v2.ncrunchproject ├── app.config ├── fixtures │ ├── .gitignore │ ├── Visual Studio │ │ ├── CodeGen │ │ │ ├── CodeGen.csproj │ │ │ ├── CodeGen.sln │ │ │ └── Generation │ │ │ │ ├── CollectionModel.cs │ │ │ │ ├── CollectionModel.cs.d.ts │ │ │ │ ├── CollectionModel.cs.js │ │ │ │ ├── Simple.cs │ │ │ │ ├── Simple.cs.d.ts │ │ │ │ ├── Simple.cs.js │ │ │ │ ├── SimpleNullable.cs │ │ │ │ ├── SimpleNullable.cs.d.ts │ │ │ │ └── SimpleNullable.cs.js │ │ ├── LegacySettings │ │ │ ├── LegacySettings.sln │ │ │ └── WE2013-settings.xml │ │ ├── LessDependencies │ │ │ ├── Areas │ │ │ │ ├── Manager.less │ │ │ │ └── _admin.less │ │ │ ├── Home.less │ │ │ ├── LessDependencies.csproj │ │ │ ├── LessDependencies.sln │ │ │ └── _shared.less │ │ └── ProjectEnumeration │ │ │ ├── CPP-Normal │ │ │ ├── CPP-Normal.vcxproj │ │ │ └── CPP-Normal.vcxproj.filters │ │ │ ├── CPP-WinStore │ │ │ ├── CPP-WinStore.vcxproj │ │ │ └── CPP-WinStore.vcxproj.filters │ │ │ ├── CS-Normal │ │ │ └── CS-Normal.csproj │ │ │ ├── CS-WinStore │ │ │ └── CS-WinStore.csproj │ │ │ ├── JS-WinStore │ │ │ └── JS-WinStore.jsproj │ │ │ ├── ProjectEnumeration.sln │ │ │ ├── Web-Normal │ │ │ ├── Web-Normal.csproj │ │ │ └── Web.config │ │ │ └── Website-Project │ │ │ └── Web.config │ ├── coffee │ │ ├── compiled │ │ │ └── test.js │ │ └── source │ │ │ ├── test.coffee │ │ │ └── test.js │ ├── handlebars │ │ ├── compiled │ │ │ └── test.hbs.js │ │ └── source │ │ │ └── test.hbs │ ├── iced │ │ ├── compiled │ │ │ └── test.js │ │ └── source │ │ │ └── test.iced │ ├── jshint │ │ ├── .jshintignore │ │ ├── config │ │ │ ├── .jshintrc │ │ │ └── clean.js │ │ ├── default.js │ │ └── skip.js │ ├── less │ │ ├── URLs.css │ │ ├── URLs.less │ │ ├── _Deep Inclusion.css │ │ ├── _Deep Inclusion.less │ │ ├── _Entry1.css │ │ ├── _Entry1.less │ │ ├── css │ │ │ ├── URLs.css │ │ │ ├── _Deep Inclusion.css │ │ │ └── _Entry1.css │ │ └── sub1 │ │ │ ├── _Entry2.css │ │ │ ├── _Entry2.less │ │ │ ├── css │ │ │ └── _Entry2.css │ │ │ └── deeper │ │ │ ├── _Entry3.css │ │ │ ├── _Entry3.less │ │ │ ├── _lib.css │ │ │ ├── _lib.less │ │ │ └── css │ │ │ ├── _Entry3.css │ │ │ └── _lib.css │ ├── module-resolution │ │ ├── a.js │ │ ├── b │ │ │ ├── c.js │ │ │ ├── d.js │ │ │ └── package │ │ │ │ └── index.js │ │ ├── cycles │ │ │ ├── folder │ │ │ │ └── foo.js │ │ │ └── root.js │ │ ├── empty │ │ │ └── .gitkeep │ │ ├── foo │ │ ├── global │ │ │ └── plain.js │ │ ├── nested-index │ │ │ ├── one │ │ │ │ ├── hello.js │ │ │ │ └── index.js │ │ │ ├── three.js │ │ │ ├── three │ │ │ │ └── index.js │ │ │ └── two │ │ │ │ ├── hello.js │ │ │ │ └── index.js │ │ └── node_modules │ │ │ ├── asdf.js │ │ │ ├── bar.js │ │ │ ├── baz │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── asdf.js │ │ │ └── otherFile.js │ │ │ ├── foo.js │ │ │ └── node_modules │ │ │ └── bar.js │ ├── scss │ │ ├── extend.css │ │ └── extend.scss │ └── sweet.js │ │ ├── compiled │ │ └── test.js │ │ └── source │ │ └── test.sjs └── packages.config ├── ZenCoding.dll ├── appveyor.yml ├── assemblies ├── Microsoft.CSS.Core.dll ├── Microsoft.CSS.Editor.dll ├── Microsoft.Html.Core.dll ├── Microsoft.Html.Editor.dll ├── Microsoft.JSON.Core.dll ├── Microsoft.JSON.Editor.dll ├── Microsoft.VisualStudio.Html.Package.dll ├── Microsoft.VisualStudio.JSON.Package.dll ├── Microsoft.VisualStudio.ProjectSystem.Utilities.v14.0.dll ├── Microsoft.VisualStudio.Web.Extensions.dll ├── Microsoft.VisualStudio.Web.ProjectSystem.dll ├── Microsoft.Web.Core.dll └── Microsoft.Web.Editor.dll └── nuget.exe /.editorconfig: -------------------------------------------------------------------------------- 1 | # Top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | end_of_line = crlf 7 | indent_size = 4 8 | 9 | ; Match VS' default XML formatting 10 | [*.csproj] 11 | indent_style = space 12 | indent_size = 2 13 | [*.config] 14 | indent_style = space 15 | indent_size = 2 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | - [ ] CSS: Use Light Bulbs instead of Smart Tags 4 | 5 | Features that have a checkmark are complete and available for 6 | download in the 7 | [nightly build](http://vsixgallery.com/extension/5fb7364d-2e8c-44a4-95eb-2a382e30fec9/). 8 | 9 | # Changelog 10 | 11 | These are the changes to each version that has been released 12 | on the official Visual Studio extension gallery. 13 | 14 | ## 2.0.219 15 | 16 | **2016-06-19** 17 | 18 | - [x] Removed Markdown features 19 | - Replaced by [Markdown Editor](https://visualstudiogallery.msdn.microsoft.com/eaab33c3-437b-4918-8354-872dfe5d1bfe) 20 | 21 | ## 0.5.175 22 | 23 | **2015-09-11** 24 | 25 | - [x] Markdown: Full GitHub flavor supported 26 | - [x] Fixed annoying crash/hang in HTML class attribute 27 | - [x] Various bug fixes 28 | 29 | ## 0.5.156 30 | 31 | **2015-08-24** 32 | 33 | - [x] Markdown: Dot no longer triggers Intellisense (#82) 34 | - [x] Markdown: Fixed issue with embedded JSON 35 | - [x] HTML: Knockout comment outlining 36 | 37 | ## 0.5 38 | 39 | **2015-08-15** 40 | 41 | - [x] CSS: @media snippets not expanding (#79) 42 | - [x] CoffeeScript: Icon added to `.litcoffee` files 43 | - [x] Updated file nesting rules for website projects -------------------------------------------------------------------------------- /EditorExtensions/AppCache/Classify/AppCacheClassificationTypes.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text.Classification; 3 | using Microsoft.VisualStudio.Utilities; 4 | 5 | namespace MadsKristensen.EditorExtensions.AppCache 6 | { 7 | public static class AppCacheClassificationTypes 8 | { 9 | public const string Keywords = "AppCache_markup"; 10 | public const string Comment = "AppCache_Comment"; 11 | 12 | [Export, Name(AppCacheClassificationTypes.Keywords)] 13 | public static ClassificationTypeDefinition AppCacheClassificationMarkup { get; set; } 14 | } 15 | 16 | [Export(typeof(EditorFormatDefinition))] 17 | [ClassificationType(ClassificationTypeNames = AppCacheClassificationTypes.Keywords)] 18 | [Name(AppCacheClassificationTypes.Keywords)] 19 | [Order(After = Priority.Default)] 20 | [UserVisible(true)] 21 | internal sealed class AppCacheKeywordsFormatDefinition : ClassificationFormatDefinition 22 | { 23 | public AppCacheKeywordsFormatDefinition() 24 | { 25 | IsBold = true; 26 | DisplayName = "AppCache Keyword"; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /EditorExtensions/AppCache/Classify/AppCacheClassifierProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text; 3 | using Microsoft.VisualStudio.Text.Classification; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions.AppCache 7 | { 8 | [Export(typeof(IClassifierProvider))] 9 | [ContentType(AppCacheContentTypeDefinition.AppCacheContentType)] 10 | public class AppCacheClassifierProvider : IClassifierProvider 11 | { 12 | [Import] 13 | public IClassificationTypeRegistryService Registry { get; set; } 14 | 15 | public IClassifier GetClassifier(ITextBuffer textBuffer) 16 | { 17 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new AppCacheClassifier(Registry)); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /EditorExtensions/AppCache/Commands/AppCacheCreationListener.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Editor; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using Microsoft.VisualStudio.TextManager.Interop; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.AppCache 8 | { 9 | [Export(typeof(IVsTextViewCreationListener))] 10 | [ContentType(AppCacheContentTypeDefinition.AppCacheContentType)] 11 | [TextViewRole(PredefinedTextViewRoles.Document)] 12 | public class AppCacheViewCreationListener : IVsTextViewCreationListener 13 | { 14 | [Import] 15 | public IVsEditorAdaptersFactoryService EditorAdaptersFactoryService { get; set; } 16 | 17 | public void VsTextViewCreated(IVsTextView textViewAdapter) 18 | { 19 | var textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); 20 | 21 | textView.Properties.GetOrCreateSingletonProperty(() => new CommentCommandTarget(textViewAdapter, textView, "#")); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /EditorExtensions/AppCache/ContentType/AppCacheContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.AppCache 5 | { 6 | public class AppCacheContentTypeDefinition 7 | { 8 | public const string AppCacheContentType = "AppCache"; 9 | 10 | /// 11 | /// Exports the AppCache HTML content type 12 | /// 13 | [Export(typeof(ContentTypeDefinition))] 14 | [Name(AppCacheContentType)] 15 | [BaseDefinition("plaintext")] 16 | public ContentTypeDefinition IAppCacheContentType { get; set; } 17 | 18 | [Export(typeof(FileExtensionToContentTypeDefinition))] 19 | [ContentType(AppCacheContentType)] 20 | [FileExtension(".appcache")] 21 | public FileExtensionToContentTypeDefinition AppCacheFileExtension { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/BestPractices/Rules/IRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.Shell; 3 | 4 | namespace MadsKristensen.EditorExtensions 5 | { 6 | public interface IRule 7 | { 8 | string Message { get; } 9 | TaskErrorCategory Category { get; } 10 | string Question { get; } 11 | 12 | void Navigate(object sender, EventArgs e); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/BestPractices/Rules/Microdata.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Forms; 4 | using Microsoft.VisualStudio.Shell; 5 | 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | public class Microdata : IRule 9 | { 10 | public string Message 11 | { 12 | get { return "SEO: Use HTML5 microdata to add semantic meaning to the website."; } 13 | } 14 | 15 | public string Question 16 | { 17 | get { return "Do you want to browse to a tutorial?"; } 18 | } 19 | 20 | public TaskErrorCategory Category 21 | { 22 | get { return TaskErrorCategory.Message; } 23 | } 24 | 25 | public void Navigate(object sender, EventArgs e) 26 | { 27 | if (MessageBox.Show(Question, "Web Essentials", MessageBoxButtons.YesNo) == DialogResult.Yes) 28 | { 29 | Process.Start("http://www.seomoves.org/blog/build/html5-microdata-2711/"); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/BestPractices/Rules/RulesFactory.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace MadsKristensen.EditorExtensions 3 | { 4 | public static class RulesFactory 5 | { 6 | public static IRule FindRule(string id, string data, BestPractices extension) 7 | { 8 | switch (id) 9 | { 10 | case "robotstxt": 11 | return new RobotsTxtRule(extension); 12 | //case "favicon": 13 | // return new Favicon(); 14 | case "microdata": 15 | return new Microdata(); 16 | case "description": 17 | return new Description(data, extension); 18 | case "viewport": 19 | return new Viewport(data, extension); 20 | } 21 | 22 | return null; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/BrowserInfo/BrowserInfo.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | (function (browserLink, $) { 4 | /// 5 | /// 6 | 7 | var name = browserLink.initializationData.appName; 8 | 9 | function SendInfo() { 10 | 11 | var width = window.innerWidth || document.body.clientWidth; 12 | var height = window.innerHeight || document.body.clientHeight; 13 | 14 | browserLink.invoke("CollectInfo", name, width, height); 15 | } 16 | 17 | window.addEventListener('resize', function (event) { 18 | SendInfo(); 19 | }); 20 | 21 | return { 22 | 23 | onConnected: function () { // Optional. Is called when a connection is established 24 | SendInfo(); 25 | } 26 | }; 27 | }); -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/PixelPushing/CssDeltaAction.cs: -------------------------------------------------------------------------------- 1 | namespace MadsKristensen.EditorExtensions.BrowserLink.PixelPushing 2 | { 3 | public enum CssDeltaAction 4 | { 5 | Add, 6 | Update, 7 | Delete, 8 | NoOp 9 | } 10 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/PixelPushing/CssRuleBlockSyncAction.cs: -------------------------------------------------------------------------------- 1 | using EnvDTE; 2 | using Microsoft.VisualStudio.Text; 3 | 4 | namespace MadsKristensen.EditorExtensions.BrowserLink.PixelPushing 5 | { 6 | public delegate void CssRuleBlockSyncAction(Window window, ITextEdit edit); 7 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/PixelPushing/CssSelectorChangeData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace MadsKristensen.EditorExtensions.BrowserLink.PixelPushing 5 | { 6 | public class CssSelectorChangeData : IEquatable 7 | { 8 | [JsonProperty] 9 | public string Url { get; set; } 10 | [JsonProperty] 11 | public int RuleIndex { get; set; } 12 | [JsonProperty] 13 | public string NewValue { get; set; } 14 | [JsonProperty] 15 | public string OldValue { get; set; } 16 | [JsonProperty] 17 | public string Rule { get; set; } 18 | 19 | public bool Equals(CssSelectorChangeData other) 20 | { 21 | return !ReferenceEquals(other, null) && RuleIndex == other.RuleIndex 22 | && string.Equals(Rule, other.Rule, StringComparison.Ordinal) 23 | && string.Equals(Url, other.Url, StringComparison.Ordinal) 24 | && string.Equals(OldValue, other.OldValue, StringComparison.Ordinal) 25 | && string.Equals(NewValue, other.NewValue, StringComparison.Ordinal); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | return Equals(obj as CssSelectorChangeData); 31 | } 32 | 33 | public override int GetHashCode() 34 | { 35 | return Url.GetHashCode() ^ RuleIndex ^ OldValue.GetHashCode() ^ NewValue.GetHashCode(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/PixelPushing/PixelPusingModeFactory.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using System.IO; 3 | using Microsoft.VisualStudio.Web.BrowserLink; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.PixelPushing 6 | { 7 | [Export(typeof(IBrowserLinkExtensionFactory))] 8 | public class PixelPushingModeFactory : IBrowserLinkExtensionFactory 9 | { 10 | public BrowserLinkExtension CreateExtensionInstance(BrowserLinkConnection connection) 11 | { 12 | return new PixelPushingMode(connection); 13 | } 14 | 15 | public string GetScript() 16 | { 17 | using (Stream stream = GetType().Assembly.GetManifestResourceStream("MadsKristensen.EditorExtensions.BrowserLink.PixelPushing.PixelPushingModeBrowserLink.js")) 18 | using (StreamReader reader = new StreamReader(stream)) 19 | { 20 | return reader.ReadToEnd(); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/AmbientRuleContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 6 | { 7 | internal class AmbientRuleContext : IDisposable 8 | { 9 | private static readonly AmbientRuleContext Instance = new AmbientRuleContext(); 10 | private int _referenceCount; 11 | 12 | public IReadOnlyCollection Rules { get; private set; } 13 | 14 | public void Update() 15 | { 16 | Rules = RuleRegistry.GetAllRules(); 17 | } 18 | 19 | public static AmbientRuleContext GetOrCreate() 20 | { 21 | if (Interlocked.Increment(ref Instance._referenceCount) == 1) 22 | { 23 | Instance.Update(); 24 | } 25 | 26 | return Instance; 27 | } 28 | 29 | public static IReadOnlyCollection GetAllRules() 30 | { 31 | using (GetOrCreate()) 32 | { 33 | return Instance.Rules; 34 | } 35 | } 36 | 37 | public void Dispose() 38 | { 39 | Interlocked.Decrement(ref _referenceCount); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/CssDocument.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CSS.Core; 2 | using Microsoft.CSS.Core.Parser; 3 | 4 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 5 | { 6 | public class CssDocument : DocumentBase 7 | { 8 | private CssDocument(string file) 9 | : base(file) 10 | { 11 | } 12 | 13 | protected override ICssParser CreateParser() 14 | { 15 | return new CssParser(); 16 | } 17 | 18 | internal static IDocument For(string fullPath, bool createIfRequired = false) 19 | { 20 | return For(fullPath, createIfRequired, f => new CssDocument(f)); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/IDocument.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.CSS.Core.TreeItems; 5 | 6 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 7 | { 8 | public interface IDocument : IDisposable 9 | { 10 | IEnumerable Rules { get; } 11 | bool IsProcessingUnusedCssRules { get; set; } 12 | object ParseSync { get; } 13 | string FileName { get; } 14 | 15 | void Reparse(); 16 | void Reparse(string text); 17 | string GetSelectorName(RuleSet ruleSet); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/IResolutionRequiredDataSource.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 4 | { 5 | public interface IResolutionRequiredDataSource 6 | { 7 | Task ResolveAsync(UnusedCssExtension extension); 8 | } 9 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/IStylingRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.CSS.Core; 3 | using Microsoft.CSS.Core.TreeItems; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 6 | { 7 | public interface IStylingRule : IEquatable 8 | { 9 | int Column { get; } 10 | string DisplaySelectorName { get; } 11 | string File { get; } 12 | int Length { get; } 13 | int SelectorLength { get; } 14 | int Line { get; } 15 | int Offset { get; } 16 | bool Matches(RuleSet rule); 17 | RuleSet Source { get; } 18 | string CleansedSelectorName { get; } 19 | 20 | bool IsMatch(string standardizedSelectorText); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/IUsageDataSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using Microsoft.VisualStudio.Shell; 5 | 6 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 7 | { 8 | public interface IUsageDataSource 9 | { 10 | IEnumerable AllRules { get; } 11 | 12 | [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] 13 | IEnumerable GetUnusedRules(); 14 | [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] 15 | IEnumerable GetRuleUsages(); 16 | IEnumerable GetWarnings(); 17 | IEnumerable GetWarnings(Uri uri); 18 | System.Threading.Tasks.Task ResyncAsync(); 19 | void Resync(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/MessageDisplaySource.cs: -------------------------------------------------------------------------------- 1 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 2 | { 3 | public enum MessageDisplaySource 4 | { 5 | Project, 6 | Browser, 7 | Url 8 | } 9 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/RawRuleUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 6 | { 7 | public class RawRuleUsage : IEquatable 8 | { 9 | [JsonProperty] 10 | public string Selector { get; set; } 11 | [JsonProperty] 12 | public IEnumerable SourceLocations { get; private set; } 13 | 14 | public RawRuleUsage() 15 | { 16 | SourceLocations = new List(); 17 | } 18 | 19 | public bool Equals(RawRuleUsage other) 20 | { 21 | return other != null && other.Selector == Selector; 22 | } 23 | 24 | public override bool Equals(object obj) 25 | { 26 | return Equals(obj as RawRuleUsage); 27 | } 28 | 29 | public override int GetHashCode() 30 | { 31 | return Selector.GetHashCode(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/RuleUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 6 | { 7 | public class RuleUsage : IEquatable 8 | { 9 | public HashSet SourceLocations { get; private set; } 10 | public IStylingRule Rule { get; set; } 11 | 12 | public RuleUsage() 13 | { 14 | SourceLocations = new HashSet(); 15 | } 16 | 17 | public bool Equals(RuleUsage other) 18 | { 19 | return !ReferenceEquals(other, null) && other.Rule.Equals(Rule) && other.SourceLocations.SetEquals(SourceLocations); 20 | } 21 | 22 | public override bool Equals(object obj) 23 | { 24 | return Equals(obj as RuleUsage); 25 | } 26 | 27 | public override int GetHashCode() 28 | { 29 | return Rule.GetHashCode() ^ SourceLocations.Aggregate(0, (i, c) => i ^ c.GetHashCode()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/SourceLocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 5 | { 6 | public class SourceLocation : IEquatable 7 | { 8 | [JsonProperty("sourcePath")] 9 | public string FileName { get; set; } 10 | [JsonProperty("startPosition")] 11 | public int Offset { get; set; } 12 | [JsonProperty("length")] 13 | public int Length { get; set; } 14 | 15 | public bool Equals(SourceLocation other) 16 | { 17 | return !ReferenceEquals(other, null) && other.FileName == FileName && other.Offset == Offset && other.Length == Length; 18 | } 19 | 20 | public override bool Equals(object obj) 21 | { 22 | return Equals(obj as SourceLocation); 23 | } 24 | 25 | public override int GetHashCode() 26 | { 27 | return FileName.GetHashCode() ^ Offset ^ Length; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /EditorExtensions/BrowserLink/UnusedCss/UnusedCssExtensionFactory.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using System.IO; 3 | using Microsoft.VisualStudio.Web.BrowserLink; 4 | 5 | namespace MadsKristensen.EditorExtensions.BrowserLink.UnusedCss 6 | { 7 | //[Export(typeof(IBrowserLinkExtensionFactory))] 8 | public class UnusedCssExtensionFactory : IBrowserLinkExtensionFactory 9 | { 10 | public BrowserLinkExtension CreateExtensionInstance(BrowserLinkConnection connection) 11 | { 12 | return new UnusedCssExtension(connection); 13 | } 14 | 15 | public string GetScript() 16 | { 17 | using (var stream = GetType().Assembly.GetManifestResourceStream("MadsKristensen.EditorExtensions.BrowserLink.UnusedCss.UnusedCss.js")) 18 | { 19 | if (stream == null) 20 | { 21 | Logger.Log("Could not get script for extension " + typeof(UnusedCssExtension)); 22 | 23 | return ""; 24 | } 25 | 26 | using (var reader = new StreamReader(stream)) 27 | { 28 | return reader.ReadToEnd(); 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /EditorExtensions/CSON/ContentType/CsonContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.CoffeeScript 5 | { 6 | /// 7 | /// Exports the CSON content type and file extension 8 | /// 9 | public class CsonContentTypeDefinition 10 | { 11 | public const string CsonContentType = "CSON"; 12 | 13 | /// 14 | /// Exports the CSON content type 15 | /// 16 | [Export(typeof(ContentTypeDefinition))] 17 | [Name(CsonContentType)] 18 | [BaseDefinition("CoffeeScript")] 19 | public ContentTypeDefinition ICsonContentType { get; set; } 20 | 21 | [Export(typeof(FileExtensionToContentTypeDefinition))] 22 | [ContentType(CsonContentType)] 23 | [FileExtension(".cson")] 24 | public FileExtensionToContentTypeDefinition CsonFileExtension { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Adornments/ColorTag.cs: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // This code is licensed under the Visual Studio SDK license terms. 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //*************************************************************************** 11 | 12 | using System.Windows.Media; 13 | using Microsoft.VisualStudio.Text.Tagging; 14 | 15 | namespace MadsKristensen.EditorExtensions.Css 16 | { 17 | /// 18 | /// Data tag indicating that the tagged text represents a color. 19 | /// 20 | /// 21 | /// Note that this tag has nothing directly to do with adornments or other UI. 22 | /// This sample's adornments will be produced based on the data provided in these tags. 23 | /// This separation provides the potential for other extensions to consume color tags 24 | /// and provide alternative UI or other derived functionality over this data. 25 | /// 26 | internal class ColorTag : ITag 27 | { 28 | internal readonly Color Color; 29 | 30 | internal ColorTag(Color color) 31 | { 32 | this.Color = color; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Adornments/ColorTaggerProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Text.Tagging; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.Css 8 | { 9 | [Export(typeof(ITaggerProvider))] 10 | [ContentType("css")] 11 | [TagType(typeof(ColorTag))] 12 | internal sealed class ColorTaggerProvider : ITaggerProvider 13 | { 14 | public ITagger CreateTagger(ITextBuffer buffer) where T : ITag 15 | { 16 | if (buffer == null) 17 | throw new ArgumentNullException("buffer"); 18 | 19 | return buffer.Properties.GetOrCreateSingletonProperty(() => new ColorTagger(buffer)) as ITagger; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Commands/CssSelectBrowsers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EnvDTE80; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using Microsoft.VisualStudio.TextManager.Interop; 5 | 6 | namespace MadsKristensen.EditorExtensions.Css 7 | { 8 | internal class CssSelectBrowsers : CommandTargetBase 9 | { 10 | private DTE2 _dte; 11 | 12 | public CssSelectBrowsers(IVsTextView adapter, IWpfTextView textView) 13 | : base(adapter, textView, MinifyCommandId.SelectBrowsers) 14 | { 15 | _dte = WebEssentialsPackage.DTE; 16 | } 17 | 18 | protected override bool Execute(MinifyCommandId commandId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) 19 | { 20 | BrowserSelector selector = new BrowserSelector(); 21 | selector.ShowDialog(); 22 | 23 | return true; 24 | } 25 | 26 | protected override bool IsEnabled() 27 | { 28 | if (TextView.GetSelection("css") == null) 29 | return false; 30 | var item = _dte.Solution.FindProjectItem(_dte.ActiveDocument.FullName); 31 | return item != null && item.ContainingProject != null && !string.IsNullOrEmpty(item.ContainingProject.FullName); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/CompletionProviders/VariableNameCompletionProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.CSS.Editor.Completion; 6 | using Microsoft.CSS.Core.TreeItems; 7 | 8 | namespace MadsKristensen.EditorExtensions.Css 9 | { 10 | [Export(typeof(ICssCompletionProvider))] 11 | [Name("VariableNameCompletionProvider")] 12 | internal class VariableNameCompletionProvider : ICssCompletionListProvider 13 | { 14 | public CssCompletionContextType ContextType 15 | { 16 | get { return (CssCompletionContextType)609; } 17 | } 18 | 19 | public IEnumerable GetListEntries(CssCompletionContext context) 20 | { 21 | var visitor = new CssItemCollector(); 22 | context.ContextItem.StyleSheet.Accept(visitor); 23 | 24 | foreach (Declaration dec in visitor.Items) 25 | { 26 | if (dec.IsValid && dec.PropertyName.Text.StartsWith("var-")) 27 | yield return new CompletionListEntry(dec.PropertyName.Text.Substring(4)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/ContextProviders/LessPseudoContextProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.CSS.Core; 5 | using Microsoft.VisualStudio.Utilities; 6 | using Microsoft.CSS.Core.TreeItems; 7 | using Microsoft.Web.Languages.Less.Parser; 8 | using Microsoft.CSS.Editor.Completion; 9 | using Microsoft.CSS.Core.TreeItems.Selectors; 10 | using Microsoft.CSS.Core.Parser; 11 | 12 | namespace MadsKristensen.EditorExtensions.Css 13 | { 14 | [Export(typeof(ICssCompletionContextProvider))] 15 | [Name("LessPseudoContextProvider")] 16 | [Order(Before = "Default Pseudo")] 17 | internal class LessPseudoContextProvider : ICssCompletionContextProvider 18 | { 19 | public IEnumerable ItemTypes 20 | { 21 | get 22 | { 23 | return new Type[] 24 | { 25 | typeof(PseudoClassFunctionSelector), 26 | typeof(PseudoClassSelector), 27 | typeof(PseudoElementFunctionSelector), 28 | typeof(PseudoElementSelector) 29 | }; 30 | } 31 | } 32 | 33 | public CssCompletionContext GetCompletionContext(ParseItem item, int position) 34 | { 35 | RuleSet rule = item.FindType(); 36 | 37 | if (rule != null && rule.Parent is LessRuleBlock) 38 | { 39 | return new CssCompletionContext(CssCompletionContextType.Invalid, item.Start, item.Length, item); 40 | } 41 | 42 | return null; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/ContextProviders/MediaQueryContextProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.CSS.Core; 5 | using Microsoft.VisualStudio.Utilities; 6 | using Microsoft.CSS.Core.TreeItems.AtDirectives; 7 | using Microsoft.CSS.Core.Parser; 8 | using Microsoft.CSS.Editor.Completion; 9 | 10 | namespace MadsKristensen.EditorExtensions.Css 11 | { 12 | [Export(typeof(ICssCompletionContextProvider))] 13 | [Name("MediaQueryCompletionContextProvider")] 14 | internal class MediaQueryCompletionContextProvider : ICssCompletionContextProvider 15 | { 16 | public IEnumerable ItemTypes 17 | { 18 | get 19 | { 20 | return new Type[] { typeof(MediaQuery), }; 21 | } 22 | } 23 | 24 | public CssCompletionContext GetCompletionContext(ParseItem item, int position) 25 | { 26 | var token = item.StyleSheet.ItemBeforePosition(position); 27 | 28 | // Don't handle expressions. MediaFeatureContextProvider.cs does that 29 | if (token.FindType() != null) 30 | return null; 31 | 32 | return new CssCompletionContext((CssCompletionContextType)612, token.Start, token.Length, null); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/ContextProviders/VariableContextProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.CSS.Core; 5 | using Microsoft.VisualStudio.Utilities; 6 | using Microsoft.CSS.Core.Parser; 7 | using Microsoft.CSS.Core.TreeItems.Functions; 8 | using Microsoft.CSS.Editor.Completion; 9 | 10 | namespace MadsKristensen.EditorExtensions.Css 11 | { 12 | [Export(typeof(ICssCompletionContextProvider))] 13 | [Name("VariableContextProvider")] 14 | internal class VariableContextProvider : ICssCompletionContextProvider 15 | { 16 | public VariableContextProvider() 17 | { 18 | } 19 | 20 | public IEnumerable ItemTypes 21 | { 22 | get 23 | { 24 | return new Type[] { typeof(Function), }; 25 | } 26 | } 27 | 28 | public CssCompletionContext GetCompletionContext(ParseItem item, int position) 29 | { 30 | Function func = (Function)item; 31 | if (func.FunctionName == null && func.FunctionName.Text != "var-") 32 | return null; 33 | 34 | return new CssCompletionContext((CssCompletionContextType)609, func.Arguments.TextStart, func.Arguments.TextLength, null); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/Filter/HideUncommonCompletionListFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.Specialized; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.CSS.Editor.Completion; 6 | using Microsoft.Web.Editor.Completion; 7 | 8 | namespace MadsKristensen.EditorExtensions.Css 9 | { 10 | [Export(typeof(ICssCompletionListFilter))] 11 | [Name("HideUncommonCompletionListFilter")] 12 | internal class HideUncommonCompletionListFilter : ICssCompletionListFilter 13 | { 14 | private static readonly StringCollection _cache = new StringCollection() 15 | { 16 | "widows", // Rarely used and get's in the way of "width" 17 | }; 18 | 19 | public void FilterCompletionList(IList completions, CssCompletionContext context) 20 | { 21 | if (context.ContextType != CssCompletionContextType.PropertyName) 22 | return; 23 | 24 | foreach (CssCompletionEntry entry in completions) 25 | { 26 | if (_cache.Contains(entry.DisplayText)) 27 | { 28 | entry.FilterType = CompletionEntryFilterTypes.NeverVisible; 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/IconProviders/BaseRegexCompletionEntryGlyphProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Media; 5 | using Microsoft.CSS.Editor.Completion; 6 | 7 | namespace MadsKristensen.EditorExtensions.CSS 8 | { 9 | class BaseRegexCompletionEntryGlyphProvider : ICssCompletionEntryGlyphProvider 10 | { 11 | protected ImageSource Icon { get; set; } 12 | protected Regex RegExp { get; set; } 13 | 14 | public BaseRegexCompletionEntryGlyphProvider(ImageSource icon, Regex regex) 15 | { 16 | Icon = icon; 17 | RegExp = regex; 18 | } 19 | 20 | public ImageSource GetCompletionGlyph(string entryName, Uri sourceUri, CssNameType nameType) 21 | { 22 | if (sourceUri == null) 23 | { 24 | return null; 25 | } 26 | 27 | string filename = Path.GetFileName(sourceUri.ToString()).Trim(); 28 | 29 | if (RegExp.IsMatch(filename)) 30 | { 31 | return Icon; 32 | } 33 | 34 | return null; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/IconProviders/FoundationCompletionEntryGlyphProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Media.Imaging; 5 | using Microsoft.CSS.Editor.Completion; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.CSS 9 | { 10 | [Export(typeof(ICssCompletionEntryGlyphProvider))] 11 | [Name("Web Essentials Foundation")] 12 | class FoundationCompletionEntryGlyphProvider : BaseRegexCompletionEntryGlyphProvider 13 | { 14 | private static BitmapFrame _icon = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2015;component/Resources/Images/foundation.png", UriKind.RelativeOrAbsolute)); 15 | private static Regex _regex = new Regex(@"^foundation(-.*)?(\.min)?\.css$", RegexOptions.IgnoreCase | RegexOptions.Compiled); 16 | 17 | public FoundationCompletionEntryGlyphProvider() 18 | : base(_icon, _regex) 19 | { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/IconProviders/GumbyCompletionEntryGlyphProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Media.Imaging; 5 | using Microsoft.CSS.Editor.Completion; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.CSS 9 | { 10 | [Export(typeof(ICssCompletionEntryGlyphProvider))] 11 | [Name("Web Essentials Gumby")] 12 | class GumbyCompletionEntryGlyphProvider : BaseRegexCompletionEntryGlyphProvider 13 | { 14 | private static BitmapFrame _icon = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2015;component/Resources/Images/gumby.png", UriKind.RelativeOrAbsolute)); 15 | private static Regex _regex = new Regex(@"^gumby(-.*)?(\.min)?\.css$", RegexOptions.IgnoreCase | RegexOptions.Compiled); 16 | 17 | public GumbyCompletionEntryGlyphProvider() 18 | : base(_icon, _regex) 19 | { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Completion/IconProviders/SkeletonCompletionEntryGlyphProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Media.Imaging; 5 | using Microsoft.CSS.Editor.Completion; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.CSS 9 | { 10 | [Export(typeof(ICssCompletionEntryGlyphProvider))] 11 | [Name("Web Essentials Skeleton")] 12 | class SkeletonCompletionEntryGlyphProvider : BaseRegexCompletionEntryGlyphProvider 13 | { 14 | private static BitmapFrame _icon = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2015;component/Resources/Images/skeleton.png", UriKind.RelativeOrAbsolute)); 15 | private static Regex _regex = new Regex(@"^skeleton(-.*)?(\.min)?\.css$", RegexOptions.IgnoreCase | RegexOptions.Compiled); 16 | 17 | public SkeletonCompletionEntryGlyphProvider() 18 | : base(_icon, _regex) 19 | { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/MenuItems/SolutionColors.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Design; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.Shell; 4 | 5 | namespace MadsKristensen.EditorExtensions.Css 6 | { 7 | internal class SolutionColorsMenu 8 | { 9 | private OleMenuCommandService _mcs; 10 | 11 | public SolutionColorsMenu(OleMenuCommandService mcs) 12 | { 13 | _mcs = mcs; 14 | } 15 | 16 | public void SetupCommands() 17 | { 18 | CommandID commandSol = new CommandID(CommandGuids.guidDiffCmdSet, (int)CommandId.CreateSolutionColorPalete); 19 | OleMenuCommand menuCommandSol = new OleMenuCommand((s, e) => ApplySolutionSettings(), commandSol); 20 | menuCommandSol.BeforeQueryStatus += SolutionBeforeQueryStatus; 21 | _mcs.AddCommand(menuCommandSol); 22 | } 23 | 24 | private void SolutionBeforeQueryStatus(object sender, System.EventArgs e) 25 | { 26 | OleMenuCommand menuCommand = sender as OleMenuCommand; 27 | bool settingsExist = XmlColorPaletteProvider.SolutionColorsExist; 28 | 29 | var projects = ProjectHelpers.GetAllProjects(); 30 | 31 | menuCommand.Enabled = projects.Any() && !settingsExist; 32 | } 33 | 34 | private static void ApplySolutionSettings() 35 | { 36 | XmlColorPaletteProvider.CreateSolutionColors(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/NavigateTo/CssGoToLineProviderFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.NavigateTo.Interfaces; 4 | 5 | namespace MadsKristensen.EditorExtensions.Css 6 | { 7 | [Export(typeof(INavigateToItemProviderFactory))] 8 | internal sealed class CssGoToLineProviderFactory : INavigateToItemProviderFactory, INavigateToItemDisplayFactory 9 | { 10 | public bool TryCreateNavigateToItemProvider(IServiceProvider serviceProvider, out INavigateToItemProvider provider) 11 | { 12 | provider = new CssGoToLineProvider(this); 13 | return true; 14 | } 15 | 16 | public INavigateToItemDisplay CreateItemDisplay(NavigateToItem item) 17 | { 18 | return item.Tag as INavigateToItemDisplay; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Declaration/DeclarationQuickInfoControllerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions 9 | { 10 | [Export(typeof(IIntellisenseControllerProvider))] 11 | [Name("Declaration QuickInfo Controller")] 12 | [ContentType("CSS")] 13 | public class DeclarationQuickInfoControllerProvider : IIntellisenseControllerProvider 14 | { 15 | [Import] 16 | public IQuickInfoBroker QuickInfoBroker { get; set; } 17 | 18 | public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList subjectBuffers) 19 | { 20 | return new DeclarationQuickInfoController(textView, subjectBuffers, this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Declaration/DeclarationQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | [Export(typeof(IQuickInfoSourceProvider))] 9 | [Name("Declaration QuickInfo Source")] 10 | [Order(Before = "Selector QuickInfo Source")] 11 | [ContentType("CSS")] 12 | internal class DeclarationQuickInfoSourceProvider : IQuickInfoSourceProvider 13 | { 14 | public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 15 | { 16 | return new DeclarationQuickInfo(textBuffer); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Font/FontQuickInfoControllerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions 9 | { 10 | [Export(typeof(IIntellisenseControllerProvider))] 11 | [Name("Font QuickInfo Controller")] 12 | [ContentType("css")] 13 | public class FontQuickInfoControllerProvider : IIntellisenseControllerProvider 14 | { 15 | [Import] 16 | public IQuickInfoBroker QuickInfoBroker { get; set; } 17 | 18 | public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList subjectBuffers) 19 | { 20 | return new FontQuickInfoController(textView, subjectBuffers, this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Font/FontQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | [Export(typeof(IQuickInfoSourceProvider))] 9 | [Name("Font QuickInfo Source")] 10 | [Order(Before = "Default Quick Info Presenter")] 11 | [ContentType("CSS")] 12 | internal class FontQuickInfoSourceProvider : IQuickInfoSourceProvider 13 | { 14 | public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 15 | { 16 | return new FontQuickInfo(textBuffer); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Image/ImageQuickInfoControllerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.QuickInfo 9 | { 10 | [Export(typeof(IIntellisenseControllerProvider))] 11 | [Name("Image QuickInfo Controller")] 12 | [ContentType("CSS")] 13 | public class ImageQuickInfoControllerProvider : IIntellisenseControllerProvider 14 | { 15 | [Import] 16 | public IQuickInfoBroker QuickInfoBroker { get; set; } 17 | 18 | public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList subjectBuffers) 19 | { 20 | return new ImageQuickInfoController(textView, subjectBuffers, this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Image/ImageQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions.QuickInfo 7 | { 8 | [Export(typeof(IQuickInfoSourceProvider))] 9 | [Name("Image QuickInfo Source")] 10 | [Order(Before = "Default Quick Info Presenter")] 11 | [ContentType("CSS")] 12 | internal class ImageQuickInfoSourceProvider : IQuickInfoSourceProvider 13 | { 14 | public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 15 | { 16 | return new ImageQuickInfo(textBuffer); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Selector/SelectorQuickInfoControllerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions 9 | { 10 | [Export(typeof(IIntellisenseControllerProvider))] 11 | [Name("Selector QuickInfo Controller")] 12 | [ContentType("CSS")] 13 | public class SelectorQuickInfoControllerProvider : IIntellisenseControllerProvider 14 | { 15 | [Import] 16 | public IQuickInfoBroker QuickInfoBroker { get; set; } 17 | 18 | public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList subjectBuffers) 19 | { 20 | return new SelectorQuickInfoController(textView, subjectBuffers, this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/Selector/SelectorQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | [Export(typeof(IQuickInfoSourceProvider))] 9 | [Name("Selector QuickInfo Source")] 10 | [Order(Before = "Default Quick Info Presenter")] 11 | [ContentType("CSS")] 12 | internal class SelectorQuickInfoSourceProvider : IQuickInfoSourceProvider 13 | { 14 | public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 15 | { 16 | return new SelectorQuickInfo(textBuffer); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/QuickInfo/ValueOrder/ValueOrderSignatureHelpSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.Web.Editor; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions 9 | { 10 | [Export(typeof(ISignatureHelpSourceProvider))] 11 | [Name("Value Order Signature Help Source")] 12 | [Order(Before = "CSS Signature Help Source")] 13 | [ContentType(CssContentTypeDefinition.CssContentType)] 14 | internal class ValueOrderSignatureHelpSourceProvider : ISignatureHelpSourceProvider 15 | { 16 | public ISignatureHelpSource TryCreateSignatureHelpSource(ITextBuffer textBuffer) 17 | { 18 | return new ValueOrderSignatureHelpSource(textBuffer); 19 | } 20 | } 21 | 22 | [Export(typeof(ISignatureHelpSourceProvider))] 23 | [Name("Value Order Signature Help Source2")] 24 | [Order(After = "Default")] 25 | [ContentType(CssContentTypeDefinition.CssContentType)] 26 | internal class RemoveCssSignatureHelpSourceProvider : ISignatureHelpSourceProvider 27 | { 28 | public ISignatureHelpSource TryCreateSignatureHelpSource(ITextBuffer textBuffer) 29 | { 30 | return new RemoveCssSignatureHelpSource(textBuffer); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Schemas/ColorPaletteProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using System.IO; 3 | using System.Reflection; 4 | using Microsoft.CSS.Editor.Schemas; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.Css 8 | { 9 | [Export(typeof(ICssSchemaFileProvider))] 10 | [Name("ColorPaletteProvider")] 11 | internal class ColorPaletteProvider : ICssSchemaFileProvider 12 | { 13 | public string File 14 | { 15 | get 16 | { 17 | string assembly = Assembly.GetExecutingAssembly().Location; 18 | string folder = Path.GetDirectoryName(assembly); 19 | return Path.Combine(folder, "css\\schemas\\css-we-settings.xml"); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Schemas/WE-Palette.css: -------------------------------------------------------------------------------- 1 | @-we-palette{ 2 | 3 | @global{ 4 | color: #2c77ba; 5 | color: #58B3F0; 6 | color: #C6E2EE; 7 | color: #1F98C7; 8 | color: #78C1DD; 9 | color: #000000; 10 | color: #111111; 11 | color: #222222; 12 | color: #252525; 13 | color: #333333; 14 | color: #555555; 15 | color: #666666; 16 | color: #777777; 17 | color: #999999; 18 | color: #AAAAAA; 19 | color: #BBBBBB; 20 | color: #CCCCCC; 21 | color: #DDDDDD; 22 | color: #E8E8E8; 23 | color: #EEEEEE; 24 | color: #F5F5F5; 25 | color: #F9F9F9; 26 | color: #FFFFFF; 27 | } 28 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/Actions/RemoveSelectorHackSmartTagAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Media.Imaging; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.CSS.Core.TreeItems.Selectors; 6 | 7 | namespace MadsKristensen.EditorExtensions.Css 8 | { 9 | internal class RemoveSelectorHackSmartTagAction : CssSmartTagActionBase 10 | { 11 | private ITrackingSpan _span; 12 | private Selector _selector; 13 | private string _hack; 14 | 15 | public RemoveSelectorHackSmartTagAction(ITrackingSpan span, Selector url, string hackPrefix) 16 | { 17 | _span = span; 18 | _selector = url; 19 | _hack = hackPrefix; 20 | 21 | if (Icon == null) 22 | { 23 | Icon = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2015;component/Resources/Images/no_skull.png", UriKind.RelativeOrAbsolute)); 24 | } 25 | } 26 | 27 | public override string DisplayText 28 | { 29 | get { return Resources.RemoveSelectorHackSmartTagActionName; } 30 | } 31 | 32 | public override void Invoke() 33 | { 34 | using (WebEssentialsPackage.UndoContext((DisplayText))) 35 | _span.TextBuffer.Replace(_span.GetSpan(_span.TextBuffer.CurrentSnapshot), _selector.Text.Substring(_hack.Length)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/Actions/SelectorHackSmartTagAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Media.Imaging; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.CSS.Core.TreeItems.Selectors; 6 | 7 | namespace MadsKristensen.EditorExtensions.Css 8 | { 9 | internal class SelectorHackSmartTagAction : CssSmartTagActionBase 10 | { 11 | private ITrackingSpan _span; 12 | private Selector _selector; 13 | private string _hack; 14 | private string _displayText; 15 | 16 | public SelectorHackSmartTagAction(ITrackingSpan span, Selector url, string hackPrefix, string displayText) 17 | { 18 | _span = span; 19 | _selector = url; 20 | _hack = hackPrefix; 21 | _displayText = displayText; 22 | 23 | if (Icon == null) 24 | { 25 | Icon = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2015;component/Resources/Images/skull.png", UriKind.RelativeOrAbsolute)); 26 | } 27 | } 28 | 29 | public override string DisplayText 30 | { 31 | get { return this._displayText; } 32 | } 33 | 34 | public override void Invoke() 35 | { 36 | using (WebEssentialsPackage.UndoContext((DisplayText))) 37 | _span.TextBuffer.Replace(_span.GetSpan(_span.TextBuffer.CurrentSnapshot), _hack + _selector.Text); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/CssSmartTag.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | 4 | namespace MadsKristensen.EditorExtensions.Css 5 | { 6 | class CssSmartTag : SmartTag 7 | { 8 | public CssSmartTag(ReadOnlyCollection actionSets) 9 | : base(SmartTagType.Factoid, actionSets) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/CssSmartTagActionBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Windows.Media; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | 5 | namespace MadsKristensen.EditorExtensions.Css 6 | { 7 | internal abstract class CssSmartTagActionBase : ISmartTagAction 8 | { 9 | public virtual ReadOnlyCollection ActionSets 10 | { 11 | get { return null; } 12 | } 13 | 14 | public virtual string DisplayText 15 | { 16 | get { return "NO DISPLAY TEXT SPECIFIED"; } 17 | } 18 | 19 | public ImageSource Icon { get; protected set; } 20 | 21 | public bool IsEnabled 22 | { 23 | get { return true; } 24 | } 25 | 26 | public abstract void Invoke(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/CssSmartTagProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using System.Diagnostics.CodeAnalysis; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Text.Tagging; 7 | using Microsoft.VisualStudio.Utilities; 8 | using Microsoft.Web.Editor; 9 | using Microsoft.Web.Core.ContentTypes; 10 | 11 | namespace MadsKristensen.EditorExtensions.Css 12 | { 13 | [Export(typeof(IViewTaggerProvider))] 14 | [ContentType(CssContentTypeDefinition.CssContentType)] 15 | [TagType(typeof(SmartTag))] 16 | internal class SmartTagProvider : IViewTaggerProvider 17 | { 18 | [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] 19 | public ITagger CreateTagger(ITextView textView, ITextBuffer textBuffer) where T : ITag 20 | { 21 | CssSmartTagger tagger = new CssSmartTagger(textView, textBuffer); 22 | return tagger as ITagger; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/ICssSmartTagProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Language.Intellisense; 5 | using Microsoft.VisualStudio.Text; 6 | using Microsoft.VisualStudio.Text.Editor; 7 | using Microsoft.CSS.Core.Parser; 8 | 9 | namespace MadsKristensen.EditorExtensions.Css 10 | { 11 | interface ICssSmartTagProvider 12 | { 13 | Type ItemType { get; } 14 | IEnumerable GetSmartTagActions(ParseItem item, int caretPosition, ITrackingSpan itemTrackingSpan, ITextView view); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/Providers/RemoveCssRuleSmartTagProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using MadsKristensen.EditorExtensions.BrowserLink.UnusedCss; 5 | using Microsoft.CSS.Core; 6 | using Microsoft.VisualStudio.Language.Intellisense; 7 | using Microsoft.VisualStudio.Text; 8 | using Microsoft.VisualStudio.Text.Editor; 9 | using Microsoft.VisualStudio.Utilities; 10 | 11 | namespace MadsKristensen.EditorExtensions.Css 12 | { 13 | [Export(typeof(ICssSmartTagProvider))] 14 | [Name("RemoveCssRuleSmartTagProvider")] 15 | internal class RemoveCssRuleSmartTagProvider : ICssSmartTagProvider 16 | { 17 | public Type ItemType 18 | { 19 | get { return typeof(Selector); } 20 | } 21 | 22 | public IEnumerable GetSmartTagActions(ParseItem item, int position, ITrackingSpan itemTrackingSpan, ITextView view) 23 | { 24 | RuleSet rule = item.FindType(); 25 | if (rule == null || rule.Block == null || !rule.Block.IsValid || UsageRegistry.IsRuleUsed(rule)) 26 | yield break; 27 | 28 | yield return new RemoveCssRuleSmartTagAction(itemTrackingSpan, rule); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/Providers/ReverseEmbedSmartTagProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.CSS.Core; 5 | using Microsoft.VisualStudio.Language.Intellisense; 6 | using Microsoft.VisualStudio.Text; 7 | using Microsoft.VisualStudio.Text.Editor; 8 | using Microsoft.VisualStudio.Utilities; 9 | using Microsoft.CSS.Core.TreeItems.Functions; 10 | using Microsoft.CSS.Core.Parser; 11 | 12 | namespace MadsKristensen.EditorExtensions.Css 13 | { 14 | [Export(typeof(ICssSmartTagProvider))] 15 | [Name("ReverseEmbedSmartTagProvider")] 16 | internal class ReverseEmbedSmartTagProvider : ICssSmartTagProvider 17 | { 18 | public Type ItemType 19 | { 20 | get { return typeof(UrlItem); } 21 | } 22 | 23 | public IEnumerable GetSmartTagActions(ParseItem item, int position, ITrackingSpan itemTrackingSpan, ITextView view) 24 | { 25 | UrlItem url = (UrlItem)item; 26 | if (!url.IsValid || url.UrlString == null) 27 | yield break; 28 | 29 | if (url.UrlString.Text.Contains(";base64,")) 30 | { 31 | yield return new ReverseEmbedSmartTagAction(itemTrackingSpan, url); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/SmartTags/Providers/SortSmartTagProvider.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.ComponentModel.Composition; 4 | //using Microsoft.CSS.Core; 5 | //using Microsoft.VisualStudio.Language.Intellisense; 6 | //using Microsoft.VisualStudio.Text; 7 | //using Microsoft.VisualStudio.Text.Editor; 8 | //using Microsoft.VisualStudio.Utilities; 9 | 10 | //namespace MadsKristensen.EditorExtensions.Css 11 | //{ 12 | // [Export(typeof(ICssSmartTagProvider))] 13 | // [Name("SortSmartTagProvider")] 14 | // internal class SortSmartTagProvider : ICssSmartTagProvider 15 | // { 16 | // public Type ItemType 17 | // { 18 | // get { return typeof(Selector); } 19 | // } 20 | 21 | // public IEnumerable GetSmartTagActions(ParseItem item, int position, ITrackingSpan itemTrackingSpan, ITextView view) 22 | // { 23 | // RuleSet rule = item.FindType(); 24 | // if (rule == null || !rule.IsValid || !rule.Block.IsValid) 25 | // yield break; 26 | 27 | // yield return new SortSmartTagAction(rule, itemTrackingSpan, view); 28 | // } 29 | // } 30 | //} 31 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/Filters/ExtendCssErrorFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.Web.Languages.Less.Parser; 6 | using Microsoft.CSS.Core.Checker; 7 | 8 | namespace MadsKristensen.EditorExtensions.Css 9 | { 10 | [Export(typeof(ICssErrorFilter))] 11 | [Name("Extend Errors")] 12 | [Order(After = "Default")] 13 | internal class ExtendCssErrorFilter : ICssErrorFilter 14 | { 15 | public void FilterErrorList(IList errors, ICssCheckerContext context) 16 | { 17 | if (errors == null || context == null) 18 | return; 19 | 20 | for (int i = errors.Count - 1; i > -1; i--) 21 | { 22 | ICssError error = errors[i]; 23 | 24 | if (error.Item == null || error.Item.StyleSheet == null || string.IsNullOrEmpty(error.Item.Text) || !(error.Item.StyleSheet is LessStyleSheet)) 25 | continue; 26 | 27 | // Remove errors from using the :extend pseudo class 28 | if (error.Item.Text.Contains(":extend(")) 29 | errors.RemoveAt(i); 30 | 31 | // Remove errors from using partial selectors 32 | else if (error.Item.PreviousSibling != null && error.Item.PreviousSibling.Text == "&") 33 | errors.RemoveAt(i); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/Filters/MsFilterCssErrorFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.CSS.Core.Checker; 6 | using Microsoft.CSS.Core.TreeItems; 7 | 8 | namespace MadsKristensen.EditorExtensions.Css 9 | { 10 | [Export(typeof(ICssErrorFilter))] 11 | [Name("MsFilterCssErrorFilter")] 12 | [Order(After = "Default")] 13 | internal class MsFilterCssErrorFilter : ICssErrorFilter 14 | { 15 | public void FilterErrorList(IList errors, ICssCheckerContext context) 16 | { 17 | for (int i = errors.Count - 1; i > -1; i--) 18 | { 19 | ICssError error = errors[i]; 20 | Declaration dec = error.Item.FindType(); 21 | if (dec != null && dec.IsValid && dec.PropertyName.Text == "-ms-filter") 22 | { 23 | errors.RemoveAt(i); 24 | errors.Insert(i, CreateNewError(error)); 25 | } 26 | } 27 | } 28 | 29 | private static SimpleErrorTag CreateNewError(ICssError error) 30 | { 31 | string message = error.Text + " " + " The value must be wrapped in single or double quotation marks."; 32 | return new SimpleErrorTag(error.Item, message, CssErrorFlags.TaskListError | CssErrorFlags.UnderlineRed); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/Filters/MsKeyframesCssErrorFilter.cs: -------------------------------------------------------------------------------- 1 | //using System.Collections.Generic; 2 | //using System.ComponentModel.Composition; 3 | //using Microsoft.CSS.Core; 4 | //using Microsoft.VisualStudio.Utilities; 5 | 6 | //namespace MadsKristensen.EditorExtensions.Css 7 | //{ 8 | // [Export(typeof(ICssErrorFilter))] 9 | // [Name("MsKeyframesCssErrorFilter")] 10 | // [Order(After = "Default")] 11 | // internal class MsKeyframesCssErrorFilter : ICssErrorFilter 12 | // { 13 | // private const string _message = " IE only supports the standard @keyframes implementation."; 14 | 15 | // public void FilterErrorList(IList errors, ICssCheckerContext context) 16 | // { 17 | // for (int i = errors.Count - 1; i > -1; i--) 18 | // { 19 | // ICssError error = errors[i]; 20 | // if (error.Item.IsValid) 21 | // { 22 | // AtDirective atDir = error.Item.FindType(); 23 | // if (atDir != null && atDir.IsValid && atDir.Keyword.Text == "-ms-keyframes") 24 | // { 25 | // errors.RemoveAt(i); 26 | // ICssError tag = new SimpleErrorTag(error.Item, error.Text + _message, CssErrorFlags.TaskListError | CssErrorFlags.UnderlineRed); 27 | // errors.Insert(i, tag); 28 | // } 29 | // } 30 | // } 31 | // } 32 | // } 33 | //} -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/Filters/VariableCssErrorFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.CSS.Core.Checker; 6 | using Microsoft.CSS.Core.TreeItems; 7 | 8 | namespace MadsKristensen.EditorExtensions.Css 9 | { 10 | [Export(typeof(ICssErrorFilter))] 11 | [Name("VarCssErrorFilter")] 12 | [Order(After = "Default")] 13 | internal class VarCssErrorFilter : ICssErrorFilter 14 | { 15 | public void FilterErrorList(IList errors, ICssCheckerContext context) 16 | { 17 | for (int i = errors.Count - 1; i > -1; i--) 18 | { 19 | ICssError error = errors[i]; 20 | Declaration dec = error.Item.FindType(); 21 | if (dec != null && (dec.Text.Contains("var-") || dec.Text.Contains("var("))) 22 | { 23 | errors.RemoveAt(i); 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/Providers/MediaQuerySyntaxErrorTagProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using Microsoft.CSS.Core; 5 | using Microsoft.VisualStudio.Utilities; 6 | using Microsoft.CSS.Core.Checker; 7 | using Microsoft.CSS.Core.Parser; 8 | using Microsoft.CSS.Core.TreeItems.AtDirectives; 9 | 10 | namespace MadsKristensen.EditorExtensions.Css 11 | { 12 | [Export(typeof(ICssItemChecker))] 13 | [Name("MediaQuerySyntaxErrorTagProvider")] 14 | [Order(After = "Default Declaration")] 15 | internal class MediaQuerySyntaxErrorTagProvider : ICssItemChecker 16 | { 17 | private const string _orInvalidMessage = "Validation: CSS media queries uses ',' as a logical or operation."; 18 | public ItemCheckResult CheckItem(ParseItem item, ICssCheckerContext context) 19 | { 20 | if (item.IsValid) 21 | return ItemCheckResult.Continue; 22 | 23 | if (item.Text.Contains(" or ")) 24 | { 25 | ICssError tag = new SimpleErrorTag(item, _orInvalidMessage); 26 | context.AddError(tag); 27 | return ItemCheckResult.CancelCurrentItem; 28 | } 29 | 30 | return ItemCheckResult.Continue; 31 | } 32 | 33 | public IEnumerable ItemTypes 34 | { 35 | get { return new[] { typeof(MediaQuery) }; } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/SelectorErrorTag.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using MadsKristensen.EditorExtensions.Settings; 3 | using Microsoft.CSS.Core; 4 | using Microsoft.CSS.Core.Utilities; 5 | using Microsoft.CSS.Core.TreeItems.Selectors; 6 | using Microsoft.CSS.Core.Checker; 7 | using Microsoft.CSS.Core.Parser; 8 | 9 | namespace MadsKristensen.EditorExtensions.Css 10 | { 11 | internal class SelectorErrorTag : ICssError 12 | { 13 | private SortedRangeList _range; 14 | 15 | public SelectorErrorTag(SortedRangeList range, string text) 16 | { 17 | _range = range; 18 | Flags = WESettings.Instance.Css.ValidationLocation.ToCssErrorFlags(); 19 | Text = text; 20 | } 21 | 22 | public ParseItem Item 23 | { 24 | get { return _range.First(); } 25 | } 26 | 27 | public string Text { get; private set; } 28 | 29 | public int AfterEnd 30 | { 31 | get { return _range.Last().AfterEnd; } 32 | } 33 | 34 | public int Length 35 | { 36 | get { return AfterEnd - Start; } 37 | } 38 | 39 | public int Start 40 | { 41 | get { return _range.First().Start; } 42 | } 43 | 44 | public CssErrorFlags Flags { get; private set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /EditorExtensions/CSS/Validation/SimpleErrorTag.cs: -------------------------------------------------------------------------------- 1 | using MadsKristensen.EditorExtensions.Settings; 2 | using Microsoft.CSS.Core; 3 | using Microsoft.CSS.Core.Checker; 4 | using Microsoft.CSS.Core.Parser; 5 | 6 | namespace MadsKristensen.EditorExtensions.Css 7 | { 8 | internal class SimpleErrorTag : ICssError 9 | { 10 | 11 | public SimpleErrorTag(ParseItem item, string errorMessage, CssErrorFlags flags) 12 | : this(item, errorMessage, item.AfterEnd - item.Start, flags) 13 | { } 14 | 15 | public SimpleErrorTag(ParseItem item, string errorMessage) 16 | : this(item, errorMessage, item.AfterEnd - item.Start) 17 | { } 18 | 19 | public SimpleErrorTag(ParseItem item, string errorMessage, int length) 20 | : this(item, errorMessage, length, WESettings.Instance.Css.ValidationLocation.ToCssErrorFlags()) 21 | { } 22 | public SimpleErrorTag(ParseItem item, string errorMessage, int length, CssErrorFlags flags) 23 | { 24 | Item = item; 25 | Text = errorMessage; 26 | Length = length; 27 | Flags = flags; 28 | } 29 | 30 | public ParseItem Item { get; private set; } 31 | public string Text { get; private set; } 32 | 33 | public int AfterEnd { get { return Item.AfterEnd; } } 34 | public int Start { get { return Item.Start; } } 35 | public int Length { get; private set; } 36 | public CssErrorFlags Flags { get; private set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /EditorExtensions/CodeAnalysis.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /EditorExtensions/Dockerfile/Classify/DockerfileClassificationTypes.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.StandardClassification; 3 | using Microsoft.VisualStudio.Text.Classification; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | public static class DockerfileClassificationTypes 9 | { 10 | public const string Keyword = "Dockerfile Token"; 11 | 12 | [Export, Name(DockerfileClassificationTypes.Keyword)] 13 | public static ClassificationTypeDefinition DockerfileClassificationBold { get; set; } 14 | } 15 | 16 | [Export(typeof(EditorFormatDefinition))] 17 | [ClassificationType(ClassificationTypeNames = DockerfileClassificationTypes.Keyword)] 18 | [Name(DockerfileClassificationTypes.Keyword)] 19 | [Order(After = Priority.High)] 20 | [UserVisible(true)] 21 | internal sealed class DockerfileBoldFormatDefinition : ClassificationFormatDefinition 22 | { 23 | public DockerfileBoldFormatDefinition() 24 | { 25 | IsBold = true; 26 | DisplayName = DockerfileClassificationTypes.Keyword; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/AppleLinkCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.Utilities; 4 | using Microsoft.Web.Editor; 5 | using Microsoft.Html.Editor.Completion.Def; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [HtmlCompletionProvider(Microsoft.Html.Editor.Completion.Def.CompletionTypes.Values, "link", "sizes")] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | public class AppleLinkCompletion : StaticListCompletion 13 | { 14 | protected override string KeyProperty { get { return "rel"; } } 15 | public AppleLinkCompletion() 16 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "apple-touch-icon", Values("16x16", "32x32", "57x57", "60x60", "72x72", "76x76","96x96", "114x114", "120x120", "144x144", "152x152", "180x180", "192x192") } 19 | }) { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/AppleMetaCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.Web.Editor; 6 | using Microsoft.Html.Editor.Completion.Def; 7 | using Microsoft.Web.Core.ContentTypes; 8 | 9 | namespace MadsKristensen.EditorExtensions.Html 10 | { 11 | [HtmlCompletionProvider(Microsoft.Html.Editor.Completion.Def.CompletionTypes.Values, "meta", "content")] 12 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 13 | public class AppleMetaCompletion : StaticListCompletion 14 | { 15 | protected override string KeyProperty { get { return "name"; } } 16 | public AppleMetaCompletion() 17 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 18 | { 19 | { "apple-mobile-web-app-capable", Values("yes", "no") }, 20 | { "format-detection", Values("telephone=yes", "telephone=no") }, 21 | { "apple-mobile-web-app-status-bar-style", Values("default", "black", "black-translucent") } 22 | }) { } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/Filters/MsApplicationCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.Composition; 4 | using System.Windows.Media.Imaging; 5 | using Microsoft.Html.Editor.Completion; 6 | using Microsoft.Html.Editor.Completion.Def; 7 | using Microsoft.VisualStudio.Imaging; 8 | using Microsoft.VisualStudio.Utilities; 9 | using Microsoft.Web.Core.ContentTypes; 10 | 11 | namespace MadsKristensen.EditorExtensions.Html 12 | { 13 | [Export(typeof(IHtmlCompletionListFilter))] 14 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 15 | public class MSApplicationCompletionFilter : IHtmlCompletionListFilter 16 | { 17 | private static BitmapSource _icon = ImageHelper.GetImage(KnownMonikers.Windows); 18 | public void FilterCompletionList(IList completions, HtmlCompletionContext context) 19 | { 20 | foreach (var completion in completions) 21 | { 22 | if (completion.DisplayText.StartsWith("msapplication-", StringComparison.OrdinalIgnoreCase)|| 23 | completion.DisplayText.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)) 24 | { 25 | completion.IconSource = _icon; 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/FragmentCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.Utilities; 4 | using Microsoft.Web.Editor; 5 | using Microsoft.Html.Editor.Completion.Def; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [HtmlCompletionProvider(CompletionTypes.Values, "meta", "content")] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | public class FragmentCompletion : StaticListCompletion 13 | { 14 | protected override string KeyProperty { get { return "name"; } } 15 | public FragmentCompletion() 16 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "fragment", Values("!") } 19 | }) { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/MiscMetaCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.Utilities; 4 | using Microsoft.Web.Editor; 5 | using Microsoft.Html.Editor.Completion.Def; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [HtmlCompletionProvider(Microsoft.Html.Editor.Completion.Def.CompletionTypes.Values, "meta", "content")] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | public class MiscMetaCompletion : StaticListCompletion 13 | { 14 | protected override string KeyProperty { get { return "name"; } } 15 | public MiscMetaCompletion() 16 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "generator", Values("Visual Studio") }, 19 | { "robots", Values("index", "noindex", "follow", "nofollow", "noindex, nofollow", "noindex, follow", "index, nofollow") } 20 | }) { } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/SimpleHtmlCompletion.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | using Microsoft.Web.Editor; 3 | using vs = Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.Html.Editor.Completion; 5 | using Microsoft.Html.Editor.Completion.Html; 6 | using Microsoft.Web.Editor.Imaging; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | public class SimpleHtmlCompletion : HtmlCompletion 11 | { 12 | private static ImageSource _glyph = GlyphService.GetGlyph(vs.StandardGlyphGroup.GlyphGroupVariable, vs.StandardGlyphItem.GlyphItemPublic); 13 | 14 | public SimpleHtmlCompletion(string displayText, vs.ICompletionSession session) 15 | : base(displayText, displayText, string.Empty, _glyph, HtmlIconAutomationText.AttributeIconText, session) 16 | { } 17 | 18 | public SimpleHtmlCompletion(string displayText, string description, vs.ICompletionSession session) 19 | : base(displayText, displayText, description, _glyph, HtmlIconAutomationText.AttributeIconText, session) 20 | { } 21 | 22 | public SimpleHtmlCompletion(string displayText, string description, string insertion, ImageSource glyph, vs.ICompletionSession session) 23 | : base(displayText, insertion, description, glyph, HtmlIconAutomationText.AttributeIconText, session) 24 | { } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/TwitterCardCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.Utilities; 4 | using Microsoft.Web.Editor; 5 | using Microsoft.Html.Editor.Completion.Def; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [HtmlCompletionProvider(CompletionTypes.Values, "meta", "content")] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | public class TwitterCardCompletion : StaticListCompletion 13 | { 14 | protected override string KeyProperty { get { return "name"; } } 15 | public TwitterCardCompletion() 16 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "twitter:card", Values("app", "gallery", "photo", "player", "product", "summary", "summary_large_image") } 19 | }) { } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Completion/ViewportCompletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.VisualStudio.Utilities; 4 | using Microsoft.Web.Editor; 5 | using Microsoft.Html.Editor.Completion.Def; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [HtmlCompletionProvider(CompletionTypes.Values, "meta", "content")] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | public class ViewportCompletion : StaticListCompletion 13 | { 14 | protected override string KeyProperty { get { return "name"; } } 15 | public ViewportCompletion() 16 | : base(new Dictionary>(StringComparer.OrdinalIgnoreCase) 17 | { 18 | { "viewport", Values( 19 | "width=device-width, initial-scale=1.0", 20 | "width=device-width, initial-scale=1.0, user-scalable=no", 21 | "width=device-width, initial-scale=1.0, maximum-scale=1", 22 | "width=device-width, initial-scale=1.0, minimum-scale=1" 23 | )} 24 | }) { } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/LightBulbs/Actions/Base64DecodeLightBulbAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using Microsoft.Html.Core.Tree.Nodes; 4 | using Microsoft.Html.Editor.SuggestedActions; 5 | using Microsoft.VisualStudio.Text; 6 | using Microsoft.VisualStudio.Text.Editor; 7 | using Microsoft.Web.Editor.Text; 8 | 9 | namespace MadsKristensen.EditorExtensions.Html 10 | { 11 | internal class HtmlBase64DecodeLightBulbAction : HtmlSuggestedActionBase 12 | { 13 | public HtmlBase64DecodeLightBulbAction(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute) 14 | : base(textView, textBuffer, element, attribute, "Save as File...") 15 | { } 16 | 17 | public async override void Invoke(CancellationToken cancellationToken) 18 | { 19 | string mimeType = FileHelpers.GetMimeTypeFromBase64(Attribute.Value); 20 | string extension = FileHelpers.GetExtension(mimeType) ?? "png"; 21 | 22 | var fileName = FileHelpers.ShowDialog(extension); 23 | 24 | if (!string.IsNullOrEmpty(fileName) && await FileHelpers.SaveDataUriToFile(Attribute.Value, fileName)) 25 | { 26 | string relative = FileHelpers.RelativePath(TextBuffer.GetFileName(), fileName); 27 | 28 | using (WebEssentialsPackage.UndoContext((this.DisplayText))) 29 | using (ITextEdit edit = TextBuffer.CreateEdit()) 30 | { 31 | edit.Replace(Attribute.ValueRangeUnquoted.ToSpan(), relative.ToLowerInvariant()); 32 | edit.Apply(); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/LightBulbs/Actions/HtmlSuggestedActionBase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Html.Core.Tree.Nodes; 2 | using Microsoft.VisualStudio.Text; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace MadsKristensen.EditorExtensions.Html 11 | { 12 | internal abstract class HtmlSuggestedActionBase : SuggestedActionBase 13 | { 14 | public ElementNode Element { get; private set; } 15 | public AttributeNode Attribute { get; private set; } 16 | 17 | protected HtmlSuggestedActionBase(ITextView textView, ITextBuffer textBuffer, ElementNode element, string displayText) 18 | : this(textView, textBuffer, element, null, displayText) 19 | { 20 | } 21 | 22 | protected HtmlSuggestedActionBase(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute, string displayText) 23 | : base(textBuffer, textView, displayText) 24 | { 25 | Element = element; 26 | Attribute = attribute; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/LightBulbs/Actions/MinifyLightBulbAction.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using MadsKristensen.EditorExtensions.Optimization.Minification; 3 | using Microsoft.Html.Core.Tree.Nodes; 4 | using Microsoft.Html.Editor.SuggestedActions; 5 | using Microsoft.VisualStudio.Text; 6 | using Microsoft.VisualStudio.Text.Editor; 7 | using Microsoft.Web.Editor.Text; 8 | 9 | namespace MadsKristensen.EditorExtensions.Html 10 | { 11 | internal class HtmlMinifyLightBulbAction : HtmlSuggestedActionBase 12 | { 13 | public HtmlMinifyLightBulbAction(ITextView textView, ITextBuffer textBuffer, ElementNode element) 14 | : base(textView, textBuffer, element, "Minify " + (element.IsStyleBlock() ? "CSS" : "JavaScript")) 15 | { } 16 | 17 | public override void Invoke(CancellationToken cancellationToken) 18 | { 19 | string text = Element.GetText(Element.InnerRange); 20 | IFileMinifier minifier = Element.IsScriptBlock() ? (IFileMinifier)new JavaScriptFileMinifier() : new CssFileMinifier(); 21 | string result = minifier.MinifyString(text); 22 | 23 | using (WebEssentialsPackage.UndoContext((this.DisplayText))) 24 | { 25 | using (ITextEdit edit = TextBuffer.CreateEdit()) 26 | { 27 | edit.Replace(Element.InnerRange.ToSpan(), result); 28 | edit.Apply(); 29 | } 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/ClassNames/ClassPeekDefinitionItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | 5 | namespace MadsKristensen.EditorExtensions.Html 6 | { 7 | class ClassDefinitionPeekItem : IPeekableItem 8 | { 9 | internal readonly IPeekResultFactory _peekResultFactory; 10 | internal string _className; 11 | internal readonly ITextBuffer _textbuffer; 12 | 13 | public ClassDefinitionPeekItem(string className, IPeekResultFactory peekResultFactory, ITextBuffer textbuffer) 14 | { 15 | _className = className; 16 | _peekResultFactory = peekResultFactory; 17 | _textbuffer = textbuffer; 18 | } 19 | 20 | public string DisplayName 21 | { 22 | // This is unused, and was supposed to have been removed from IPeekableItem. 23 | get { return null; } 24 | } 25 | 26 | public IEnumerable Relationships 27 | { 28 | get { yield return PredefinedPeekRelationships.Definitions; } 29 | } 30 | 31 | public IPeekResultSource GetOrCreateResultSource(string relationshipName) 32 | { 33 | return new ClassResultSource(this); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/ClassNames/ClassPeekItemProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.Web.Editor; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [Export(typeof(IPeekableItemSourceProvider))] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | [Name("HTML Class Peekable Item Provider")] 13 | [SupportsStandaloneFiles(false)] 14 | class ClassPeekItemProvider : IPeekableItemSourceProvider 15 | { 16 | #pragma warning disable 649 // "field never assigned to" -- field is set by MEF. 17 | [Import] 18 | private IPeekResultFactory _peekResultFactory; 19 | #pragma warning restore 649 20 | 21 | public IPeekableItemSource TryCreatePeekableItemSource(ITextBuffer textBuffer) 22 | { 23 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new ClassPeekItemSource(textBuffer, _peekResultFactory)); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/ClassNames/ClassPeekItemSource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | 5 | namespace MadsKristensen.EditorExtensions.Html 6 | { 7 | internal sealed class ClassPeekItemSource : IPeekableItemSource 8 | { 9 | private readonly ITextBuffer _textBuffer; 10 | private readonly IPeekResultFactory _peekResultFactory; 11 | 12 | public ClassPeekItemSource(ITextBuffer textBuffer, IPeekResultFactory peekResultFactory) 13 | { 14 | _textBuffer = textBuffer; 15 | _peekResultFactory = peekResultFactory; 16 | } 17 | 18 | public void AugmentPeekSession(IPeekSession session, IList peekableItems) 19 | { 20 | var triggerPoint = session.GetTriggerPoint(_textBuffer.CurrentSnapshot); 21 | if (!triggerPoint.HasValue) 22 | return; 23 | 24 | string className = HtmlHelpers.GetSinglePropertyValue(_textBuffer, triggerPoint.Value.Position, "class"); 25 | if (string.IsNullOrEmpty(className)) 26 | return; 27 | 28 | 29 | peekableItems.Add(new ClassDefinitionPeekItem(className, _peekResultFactory, _textBuffer)); 30 | } 31 | 32 | public void Dispose() 33 | { } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/IDs/IdPeekDefinitionItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | 5 | namespace MadsKristensen.EditorExtensions.Html 6 | { 7 | class IdDefinitionPeekItem : IPeekableItem 8 | { 9 | internal readonly IPeekResultFactory _peekResultFactory; 10 | internal string _id; 11 | internal readonly ITextBuffer _textbuffer; 12 | 13 | public IdDefinitionPeekItem(string id, IPeekResultFactory peekResultFactory, ITextBuffer textbuffer) 14 | { 15 | _id = id; 16 | _peekResultFactory = peekResultFactory; 17 | _textbuffer = textbuffer; 18 | } 19 | 20 | public string DisplayName 21 | { 22 | // This is unused, and was supposed to have been removed from IPeekableItem. 23 | get { return null; } 24 | } 25 | 26 | public IEnumerable Relationships 27 | { 28 | get { yield return PredefinedPeekRelationships.Definitions; } 29 | } 30 | 31 | public IPeekResultSource GetOrCreateResultSource(string relationshipName) 32 | { 33 | return new IdResultSource(this); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/IDs/IdPeekItemProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | using Microsoft.Web.Editor; 6 | using Microsoft.Web.Core.ContentTypes; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [Export(typeof(IPeekableItemSourceProvider))] 11 | [ContentType(HtmlContentTypeDefinition.HtmlContentType)] 12 | [Name("HTML ID Peekable Item Provider")] 13 | [SupportsStandaloneFiles(false)] 14 | class IdPeekItemProvider : IPeekableItemSourceProvider 15 | { 16 | #pragma warning disable 649 // "field never assigned to" -- field is set by MEF. 17 | [Import] 18 | private IPeekResultFactory _peekResultFactory; 19 | #pragma warning restore 649 20 | 21 | public IPeekableItemSource TryCreatePeekableItemSource(ITextBuffer textBuffer) 22 | { 23 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new IdPeekItemSource(textBuffer, _peekResultFactory)); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /EditorExtensions/HTML/Peek/IDs/IdPeekItemSource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | 5 | namespace MadsKristensen.EditorExtensions.Html 6 | { 7 | internal sealed class IdPeekItemSource : IPeekableItemSource 8 | { 9 | private readonly ITextBuffer _textBuffer; 10 | private readonly IPeekResultFactory _peekResultFactory; 11 | 12 | public IdPeekItemSource(ITextBuffer textBuffer, IPeekResultFactory peekResultFactory) 13 | { 14 | _textBuffer = textBuffer; 15 | _peekResultFactory = peekResultFactory; 16 | } 17 | 18 | public void AugmentPeekSession(IPeekSession session, IList peekableItems) 19 | { 20 | var triggerPoint = session.GetTriggerPoint(_textBuffer.CurrentSnapshot); 21 | if (!triggerPoint.HasValue) 22 | return; 23 | 24 | string id = HtmlHelpers.GetSinglePropertyValue(_textBuffer, triggerPoint.Value.Position, "id"); 25 | if (string.IsNullOrEmpty(id)) 26 | return; 27 | 28 | 29 | peekableItems.Add(new IdDefinitionPeekItem(id, _peekResultFactory, _textBuffer)); 30 | } 31 | 32 | public void Dispose() 33 | { 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/QuickInfo/ImageHtml/ImageQuickInfoControllerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Language.Intellisense; 4 | using Microsoft.VisualStudio.Text; 5 | using Microsoft.VisualStudio.Text.Editor; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [Export(typeof(IIntellisenseControllerProvider))] 11 | [Name("Image Html QuickInfo Controller")] 12 | [ContentType("htmlx")] 13 | public class ImageHtmlQuickInfoControllerProvider : IIntellisenseControllerProvider 14 | { 15 | [Import] 16 | public IQuickInfoBroker QuickInfoBroker { get; set; } 17 | 18 | public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList subjectBuffers) 19 | { 20 | return new ImageHtmlQuickInfoController(textView, subjectBuffers, this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/QuickInfo/ImageHtml/ImageQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions.Html 7 | { 8 | [Export(typeof(IQuickInfoSourceProvider))] 9 | [Name("Image HTML QuickInfo Source")] 10 | [Order(Before = "Default Quick Info Presenter")] 11 | [ContentType("htmlx")] 12 | internal class ImageHtmlQuickInfoSourceProvider : IQuickInfoSourceProvider 13 | { 14 | public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 15 | { 16 | return new ImageHtmlQuickInfo(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Schema/DynamicSchemaFileProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Composition; 3 | using System.IO; 4 | using System.Reflection; 5 | using Microsoft.Html.Editor.Schemas.Interfaces; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.Html 9 | { 10 | [Export(typeof(IHtmlSchemaFileInfoProvider))] 11 | [Name("Dynamic Schema Provider")] 12 | 13 | internal class DynamicSchemaFileInfoProvider : IHtmlSchemaFileInfoProvider 14 | { 15 | public IEnumerable GetSchemas(string defaultSchemaPath) 16 | { 17 | foreach (string file in Directory.EnumerateFiles(GetSchemaFolder(), "*.xsd")) 18 | { 19 | yield return HtmlSchemaFileInfo.FromFile(file); 20 | } 21 | } 22 | 23 | private static string GetSchemaFolder() 24 | { 25 | string assembly = Assembly.GetExecutingAssembly().Location; 26 | string folder = Path.GetDirectoryName(assembly); 27 | return Path.Combine(folder, "html\\schema\\schemas\\"); 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Schema/HtmlSchemaFileInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | using Microsoft.Html.Editor.Schemas.Interfaces; 3 | 4 | namespace MadsKristensen.EditorExtensions.Html 5 | { 6 | class HtmlSchemaFileInfo : IHtmlSchemaFileInfo 7 | { 8 | private static Regex _regex = new Regex("vs:customattrprefix=\"(?[^\"]+)\"", RegexOptions.IgnoreCase); 9 | 10 | public HtmlSchemaFileInfo() 11 | { 12 | IsSupplemental = true; 13 | IsXml = false; 14 | } 15 | 16 | public string CustomPrefix { get; set; } 17 | public string File { get; set; } 18 | public string FriendlyName { get; set; } 19 | public bool IsSupplemental { get; set; } 20 | public bool IsXml { get; set; } 21 | public string Uri { get; set; } 22 | 23 | public static HtmlSchemaFileInfo FromFile(string file) 24 | { 25 | HtmlSchemaFileInfo info = new HtmlSchemaFileInfo(); 26 | info.File = file; 27 | 28 | string input = System.IO.File.ReadAllText(file); 29 | Match match = _regex.Match(input); 30 | 31 | if (match.Success) 32 | { 33 | info.CustomPrefix = match.Groups["prefix"].Value; 34 | } 35 | 36 | return info; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /EditorExtensions/HTML/Schema/Schemas/aurelia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/HTML/Schema/Schemas/aurelia.png -------------------------------------------------------------------------------- /EditorExtensions/HTML/Schema/Schemas/aurelia.xsd: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /EditorExtensions/IcedCoffeeScript/ContentType/IcedCoffeeScriptContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.IcedCoffeeScript 5 | { 6 | /// 7 | /// Exports the IcedCoffeeScript content type and file extension 8 | /// 9 | public class IcedCoffeeScriptContentTypeDefinition 10 | { 11 | public const string IcedCoffeeScriptContentType = "IcedCoffeeScript"; 12 | 13 | /// 14 | /// Exports the IcedCoffeeScript content type 15 | /// 16 | [Export(typeof(ContentTypeDefinition))] 17 | [Name(IcedCoffeeScriptContentType)] 18 | [BaseDefinition("CoffeeScript")] 19 | public ContentTypeDefinition IIcedCoffeeScriptContentType { get; set; } 20 | 21 | [Export(typeof(FileExtensionToContentTypeDefinition))] 22 | [ContentType(IcedCoffeeScriptContentType)] 23 | [FileExtension(".iced")] 24 | public FileExtensionToContentTypeDefinition IcedCoffeeScriptFileExtension { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EditorExtensions/Images/Commands/WebEditorsCreationListener.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Editor; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using Microsoft.VisualStudio.TextManager.Interop; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.Images 8 | { 9 | [Export(typeof(IVsTextViewCreationListener))] 10 | [ContentType("html")] 11 | [ContentType("htmlx")] 12 | [ContentType("css")] 13 | [ContentType("javascript")] 14 | [ContentType("typescript")] 15 | [ContentType("CoffeeScript")] 16 | [TextViewRole(PredefinedTextViewRoles.Document)] 17 | public class WebEditorsViewCreationListener : IVsTextViewCreationListener 18 | { 19 | [Import] 20 | public IVsEditorAdaptersFactoryService EditorAdaptersFactoryService { get; set; } 21 | 22 | public void VsTextViewCreated(IVsTextView textViewAdapter) 23 | { 24 | var textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); 25 | 26 | textView.Properties.GetOrCreateSingletonProperty(() => new PasteImage(textViewAdapter, textView)); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /EditorExtensions/JSON-LD/ContentType/JsonLdContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.JSONLD 5 | { 6 | public class JsonLdContentTypeDefinition 7 | { 8 | public const string JsonLdContentType = "JSON-LD"; 9 | 10 | [Export(typeof(ContentTypeDefinition))] 11 | [Name(JsonLdContentType)] 12 | [BaseDefinition("json")] 13 | public ContentTypeDefinition IJsonLdContentType { get; set; } 14 | 15 | [Export(typeof(FileExtensionToContentTypeDefinition))] 16 | [ContentType(JsonLdContentType)] 17 | [FileExtension(".jsonld")] 18 | public FileExtensionToContentTypeDefinition JsonLdFileExtension { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /EditorExtensions/JSON-LD/Vocabularies/Helpers.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.Web.Editor; 4 | using Microsoft.Web.Editor.Imaging; 5 | 6 | namespace MadsKristensen.EditorExtensions.JSONLD 7 | { 8 | public class Entry 9 | { 10 | public Entry(string name, PropertyType type = PropertyType.String) 11 | { 12 | Name = name; 13 | EntryType = type; 14 | } 15 | 16 | public string Name { get; private set; } 17 | public PropertyType EntryType { get; private set; } 18 | 19 | public ImageSource Glyph 20 | { 21 | get 22 | { 23 | if (EntryType == PropertyType.Object) 24 | return GlyphService.GetGlyph(StandardGlyphGroup.GlyphGroupNamespace, StandardGlyphItem.GlyphItemPublic); 25 | 26 | if (EntryType == PropertyType.Array) 27 | return GlyphService.GetGlyph(StandardGlyphGroup.GlyphGroupType, StandardGlyphItem.TotalGlyphItems); 28 | 29 | return GlyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic); 30 | } 31 | } 32 | } 33 | 34 | public enum PropertyType 35 | { 36 | String, 37 | Object, 38 | Array, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /EditorExtensions/JSON-LD/Vocabularies/IVocabulary.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.JSON.Core.Parser; 3 | using Microsoft.JSON.Core.Parser.TreeItems; 4 | 5 | namespace MadsKristensen.EditorExtensions.JSONLD 6 | { 7 | interface IVocabulary 8 | { 9 | Dictionary> Cache { get; } 10 | 11 | string DisplayName { get; } 12 | 13 | bool AppliesToContext(JSONMember contextNode); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /EditorExtensions/JSON/Adornments/LogoLayer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text.Editor; 3 | using Microsoft.VisualStudio.Utilities; 4 | 5 | namespace MadsKristensen.EditorExtensions.JSON 6 | { 7 | class LogoLayer 8 | { 9 | public const string LayerName = "JSON Logo"; 10 | 11 | [Export(typeof(AdornmentLayerDefinition))] 12 | [Name(LayerName)] 13 | [Order(After = PredefinedAdornmentLayers.Caret)] 14 | public AdornmentLayerDefinition editorAdornmentLayer = null; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EditorExtensions/JSON/Helpers/JsonTreeVisitor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.CSS.Core; 3 | using Microsoft.JSON.Core.Parser; 4 | using Microsoft.CSS.Core.Parser; 5 | 6 | namespace MadsKristensen.EditorExtensions.JSON 7 | { 8 | internal class JSONItemCollector : IJSONSimpleTreeVisitor where T : JSONParseItem 9 | { 10 | public IList Items { get; private set; } 11 | private bool _includeChildren; 12 | 13 | public JSONItemCollector() : this(false) { } 14 | 15 | public JSONItemCollector(bool includeChildren) 16 | { 17 | _includeChildren = includeChildren; 18 | Items = new List(); 19 | } 20 | 21 | public VisitItemResult Visit(JSONParseItem parseItem) 22 | { 23 | var item = parseItem as T; 24 | 25 | if (item != null) 26 | { 27 | Items.Add(item); 28 | return (_includeChildren) ? VisitItemResult.Continue : VisitItemResult.SkipChildren; 29 | } 30 | 31 | return VisitItemResult.Continue; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /EditorExtensions/JSON/Resources/bower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/JSON/Resources/bower.png -------------------------------------------------------------------------------- /EditorExtensions/JSON/Resources/grunt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/JSON/Resources/grunt.png -------------------------------------------------------------------------------- /EditorExtensions/JSON/Resources/gulp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/JSON/Resources/gulp.png -------------------------------------------------------------------------------- /EditorExtensions/JSON/Resources/npm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/JSON/Resources/npm.png -------------------------------------------------------------------------------- /EditorExtensions/JSON/Resources/vs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/JSON/Resources/vs.png -------------------------------------------------------------------------------- /EditorExtensions/JavaScript/Classify/ES6ClassifierProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text; 3 | using Microsoft.VisualStudio.Text.Classification; 4 | using Microsoft.VisualStudio.Text.Editor; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.JavaScript 8 | { 9 | [Export(typeof(IClassifierProvider))] 10 | [ContentType("JavaScript")] 11 | [Order(After = "Default")] 12 | [TextViewRole(PredefinedTextViewRoles.Document)] 13 | public class ES6ClassifierProvider : IClassifierProvider 14 | { 15 | [Import] 16 | public IClassificationTypeRegistryService Registry { get; set; } 17 | 18 | public IClassifier GetClassifier(ITextBuffer textBuffer) 19 | { 20 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new ES6Classifier(Registry, textBuffer)); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /EditorExtensions/JavaScript/Classify/TaskClassificationTypes.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Language.StandardClassification; 2 | using Microsoft.VisualStudio.Text.Classification; 3 | using Microsoft.VisualStudio.Utilities; 4 | using System.ComponentModel.Composition; 5 | using System.Windows.Media; 6 | 7 | namespace MadsKristensen.EditorExtensions.JavaScript 8 | { 9 | public static class TaskClassificationTypes 10 | { 11 | public const string Name = "task_keyword"; 12 | 13 | [Export, Name(TaskClassificationTypes.Name)] 14 | public static ClassificationTypeDefinition TaskClassificationBold { get; set; } 15 | } 16 | 17 | [Export(typeof(EditorFormatDefinition))] 18 | [ClassificationType(ClassificationTypeNames = TaskClassificationTypes.Name)] 19 | [Name(TaskClassificationTypes.Name)] 20 | [BaseDefinition(PredefinedClassificationTypeNames.String)] 21 | [Order(After = Priority.High)] 22 | [UserVisible(true)] 23 | internal sealed class TaskBoldFormatDefinition : ClassificationFormatDefinition 24 | { 25 | public TaskBoldFormatDefinition() 26 | { 27 | IsBold = true; 28 | //ForegroundBrush = Brushes.Orange; 29 | DisplayName = "Task Name"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /EditorExtensions/JavaScript/Snippets/Web Essentials/region.snippet: -------------------------------------------------------------------------------- 1 |  2 |
3 | region 4 | Web Essentials 5 | region 6 | A snippet for adding a custom region 7 | 8 | Expansion 9 | SurroundsWith 10 | 11 |
12 | 13 | 14 | 15 | name 16 | Name value 17 | name 18 | 19 | 20 | 21 | 26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /EditorExtensions/JavaScript/Snippets/snippets.pkgdef: -------------------------------------------------------------------------------- 1 | // CSS snippets 2 | [$RootKey$\Languages\CodeExpansions\JavaScript\Paths] 3 | "Web Essentials"="$PackageFolder$\Web Essentials" 4 | -------------------------------------------------------------------------------- /EditorExtensions/Markdown/Completion/MarkdownCreationListener.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio; 3 | using Microsoft.VisualStudio.Editor; 4 | using Microsoft.VisualStudio.Text.Editor; 5 | using Microsoft.VisualStudio.TextManager.Interop; 6 | using Microsoft.VisualStudio.Utilities; 7 | 8 | namespace MadsKristensen.EditorExtensions.Markdown 9 | { 10 | [Export(typeof(IVsTextViewCreationListener))] 11 | [ContentType(MarkdownContentTypeDefinition.MarkdownContentType)] 12 | [TextViewRole(PredefinedTextViewRoles.Document)] 13 | class MarkdownCreationListener : IVsTextViewCreationListener 14 | { 15 | [Import] 16 | IVsEditorAdaptersFactoryService AdaptersFactory = null; 17 | 18 | public void VsTextViewCreated(IVsTextView textViewAdapter) 19 | { 20 | IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter); 21 | 22 | view.Options.SetOptionValue(DefaultOptions.ConvertTabsToSpacesOptionId, true); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /EditorExtensions/Misc/CodeGeneration/IntellisenseProperty.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace MadsKristensen.EditorExtensions 4 | { 5 | public class IntellisenseProperty 6 | { 7 | public IntellisenseProperty() 8 | { 9 | 10 | } 11 | public IntellisenseProperty(IntellisenseType type, string propertyName) 12 | { 13 | Type = type; 14 | Name = propertyName; 15 | } 16 | 17 | public string Name { get; set; } 18 | 19 | [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", 20 | Justification = "Unambiguous in this context.")] 21 | public IntellisenseType Type { get; set; } 22 | 23 | public string Summary { get; set; } 24 | public string InitExpression { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /EditorExtensions/Misc/MenuItems/Diff.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.Design; 3 | using Microsoft.VisualStudio.Shell; 4 | 5 | namespace MadsKristensen.EditorExtensions 6 | { 7 | internal class DiffMenu 8 | { 9 | private OleMenuCommandService _mcs; 10 | 11 | public DiffMenu(OleMenuCommandService mcs) 12 | { 13 | _mcs = mcs; 14 | } 15 | 16 | public void SetupCommands() 17 | { 18 | CommandID commandId = new CommandID(CommandGuids.guidDiffCmdSet, (int)CommandId.RunDiff); 19 | OleMenuCommand menuCommand = new OleMenuCommand((s, e) => PerformDiff(), commandId); 20 | menuCommand.BeforeQueryStatus += BeforeQueryStatus; 21 | _mcs.AddCommand(menuCommand); 22 | } 23 | 24 | private List files; 25 | 26 | private void BeforeQueryStatus(object sender, System.EventArgs e) 27 | { 28 | OleMenuCommand menuCommand = sender as OleMenuCommand; 29 | files = new List(ProjectHelpers.GetSelectedItemPaths()); 30 | 31 | menuCommand.Enabled = files.Count == 2; 32 | } 33 | 34 | private void PerformDiff() 35 | { 36 | WebEssentialsPackage.ExecuteCommand("Tools.DiffFiles", $"\"{files[0]}\" \"{files[1]}\""); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /EditorExtensions/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Resources; 4 | using System.Runtime.CompilerServices; 5 | using System.Runtime.InteropServices; 6 | using MadsKristensen.EditorExtensions; 7 | 8 | [assembly: AssemblyTitle(Vsix.Name)] 9 | [assembly: AssemblyDescription(Vsix.Description)] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany(Vsix.Author)] 12 | [assembly: AssemblyProduct(Vsix.Name)] 13 | [assembly: AssemblyCopyright(Vsix.Author)] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | [assembly: ComVisible(false)] 17 | [assembly: CLSCompliant(false)] 18 | [assembly: NeutralResourcesLanguage("en-US")] 19 | 20 | [assembly: AssemblyVersion(Vsix.Version)] 21 | [assembly: AssemblyFileVersion(Vsix.Version)] 22 | 23 | [assembly: InternalsVisibleTo("WebEssentialsTests")] 24 | 25 | -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browser Pause Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browser Pause Button.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browser Record Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browser Record Button.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/c.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/c_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/c_gray.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/e.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/ff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/ff.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/ff_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/ff_gray.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/ie.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/ie_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/ie_gray.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/o.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/o_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/o_gray.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/s.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Browsers/s_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Browsers/s_gray.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/Images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/Images.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/MenuImages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/MenuImages.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/WebEssentials2012logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/WebEssentials2012logo.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/angular.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/aurelia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/aurelia.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/blueprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/blueprint.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/bootstrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/bootstrap.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/browserlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/browserlink.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/delete.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/embed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/embed.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/extract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/extract.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/foundation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/foundation.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/gumby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/gumby.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/jsfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/jsfile.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/no_skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/no_skull.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/node_module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/node_module.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/nopreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/nopreview.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/numbers.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/palette.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/preview.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/skeleton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/skeleton.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/skull.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Images/warning.png -------------------------------------------------------------------------------- /EditorExtensions/Resources/Scripts/AngularController.js: -------------------------------------------------------------------------------- 1 | /* globals angular */ 2 | 3 | (function () {{ 4 | 'use strict'; 5 | 6 | // Controller name is handy for logging 7 | var controllerId = '{0}'; 8 | 9 | // Define the controller on the module. 10 | // Inject the dependencies. 11 | // Point to the controller definition function. 12 | angular.module('app').controller(controllerId, ['$scope', {0}]); 13 | 14 | function {0}($scope) {{ 15 | // Using 'Controller As' syntax, so we assign this to the vm variable (for viewmodel). 16 | var vm = this; 17 | 18 | // Bindable properties and functions are placed on vm. 19 | vm.activate = activate; 20 | vm.title = '{0}'; 21 | 22 | function activate() {{ 23 | }} 24 | 25 | //#region Internal Methods 26 | 27 | //#endregion 28 | }} 29 | }})(); -------------------------------------------------------------------------------- /EditorExtensions/Resources/Tools/gifsicle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Tools/gifsicle.exe -------------------------------------------------------------------------------- /EditorExtensions/Resources/Tools/jpegtran.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Tools/jpegtran.exe -------------------------------------------------------------------------------- /EditorExtensions/Resources/Tools/optipng.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Tools/optipng.exe -------------------------------------------------------------------------------- /EditorExtensions/Resources/Tools/png.cmd: -------------------------------------------------------------------------------- 1 | optipng %1 -out %2 -o3 -i0 2 | pngout %2 %2 /s1 /y /v -------------------------------------------------------------------------------- /EditorExtensions/Resources/Tools/pngout.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Resources/Tools/pngout.exe -------------------------------------------------------------------------------- /EditorExtensions/RobotsTxt/Classify/RobotsTxtClassificationTypes.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text.Classification; 3 | using Microsoft.VisualStudio.Utilities; 4 | 5 | namespace MadsKristensen.EditorExtensions 6 | { 7 | public static class RobotsTxtClassificationTypes 8 | { 9 | public const string Keyword = "robotstxt_keyword"; 10 | public const string Comment = "robotstxt_comment"; 11 | 12 | [Export, Name(RobotsTxtClassificationTypes.Keyword)] 13 | public static ClassificationTypeDefinition RobotsTxtClassificationBold { get; set; } 14 | } 15 | 16 | [Export(typeof(EditorFormatDefinition))] 17 | [ClassificationType(ClassificationTypeNames = RobotsTxtClassificationTypes.Keyword)] 18 | [Name(RobotsTxtClassificationTypes.Keyword)] 19 | [Order(After = Priority.Default)] 20 | [UserVisible(true)] 21 | internal sealed class RobotsTxtBoldFormatDefinition : ClassificationFormatDefinition 22 | { 23 | public RobotsTxtBoldFormatDefinition() 24 | { 25 | IsBold = true; 26 | DisplayName = "Robots.txt Keyword"; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /EditorExtensions/Settings/ProjectSettingsTextViewListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Text.Editor; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.Settings 8 | { 9 | [Export(typeof(IWpfTextViewCreationListener))] 10 | [ContentType("JSON")] 11 | [TextViewRole(PredefinedTextViewRoles.Document)] 12 | public class ProjectSettingsTextViewListener : IWpfTextViewCreationListener 13 | { 14 | [Import] 15 | public ITextDocumentFactoryService TextDocumentFactoryService { get; set; } 16 | 17 | public void TextViewCreated(IWpfTextView textView) 18 | { 19 | ITextDocument document; 20 | if (TextDocumentFactoryService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out document)) 21 | { 22 | document.FileActionOccurred += document_FileActionOccurred; 23 | } 24 | } 25 | 26 | private void document_FileActionOccurred(object sender, TextDocumentFileActionEventArgs e) 27 | { 28 | if (e.FileActionType == FileActionTypes.ContentSavedToDisk && e.FilePath.EndsWith(SettingsStore.FileName, StringComparison.OrdinalIgnoreCase)) 29 | { 30 | SettingsStore.Load(); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Commands/IFileSaveListener.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.Commands 5 | { 6 | ///A listener called when files are saved in the editor, as well as for compiled files on save or build. 7 | public interface IFileSaveListener 8 | { 9 | Task FileSaved(IContentType contentType, string path, bool forceSave, bool minifyInPlace); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Compilers/Result/CompilerError.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace MadsKristensen.EditorExtensions 3 | { 4 | public class CompilerError 5 | { 6 | public string FileName { get; set; } 7 | public string Message { get; set; } 8 | public string FullMessage { get; set; } 9 | public int Line { get; set; } 10 | public int Column { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /EditorExtensions/Shared/ExtensionMethods/DispatcherPriorityAwaitable.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Threading; 2 | 3 | namespace MadsKristensen.EditorExtensions 4 | { 5 | /// 6 | /// A simple awaitable type that will return a DispatcherPriorityAwaiter. 7 | /// 8 | /// 9 | /// This is returned from Dispatcher.Yield() 10 | /// 11 | public struct DispatcherPriorityAwaitable 12 | { 13 | /// 14 | /// Creates an instance of DispatcherPriorityAwaitable with the 15 | /// parameters used to configure the DispatcherPriorityAwaiter. 16 | /// 17 | public DispatcherPriorityAwaitable(Dispatcher dispatcher, DispatcherPriority priority) 18 | { 19 | _dispatcher = dispatcher; 20 | _priority = priority; 21 | } 22 | 23 | /// 24 | /// Returns a new instance of a DispatcherPriorityAwaiter, 25 | /// configured with the same parameters as this instance. 26 | /// 27 | public DispatcherPriorityAwaiter GetAwaiter() 28 | { 29 | return new DispatcherPriorityAwaiter(_dispatcher, _priority); 30 | } 31 | 32 | private readonly Dispatcher _dispatcher; 33 | private readonly DispatcherPriority _priority; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Helpers/Css/CssItemCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.CSS.Core; 3 | using Microsoft.CSS.Core.Parser; 4 | 5 | namespace MadsKristensen.EditorExtensions 6 | { 7 | /// 8 | /// Creates a list of CSS ParseItems of a certain type 9 | /// (when passed in as the visitor to any item's Accept() function) 10 | /// 11 | internal class CssItemCollector : ICssSimpleTreeVisitor where T : ParseItem 12 | { 13 | public IList Items { get; private set; } 14 | private bool _includeChildren; 15 | 16 | public CssItemCollector() : this(false) { } 17 | 18 | public CssItemCollector(bool includeChildren) 19 | { 20 | _includeChildren = includeChildren; 21 | Items = new List(); 22 | } 23 | 24 | public VisitItemResult Visit(ParseItem parseItem) 25 | { 26 | var item = parseItem as T; 27 | 28 | if (item != null) 29 | { 30 | Items.Add(item); 31 | return (_includeChildren) ? VisitItemResult.Continue : VisitItemResult.SkipChildren; 32 | } 33 | 34 | return VisitItemResult.Continue; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Helpers/Policies/PolicyFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Practices.TransientFaultHandling; 3 | 4 | namespace MadsKristensen.EditorExtensions 5 | { 6 | public static class PolicyFactory 7 | { 8 | public static RetryPolicy GetPolicy(ITransientErrorDetectionStrategy strategy, int retryCount) 9 | { 10 | RetryPolicy policy = new RetryPolicy(strategy, retryCount, TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(50)); 11 | 12 | return policy; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Helpers/Policies/Strategies/FileTransientErrorDetectionStrategy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Practices.TransientFaultHandling; 3 | 4 | namespace MadsKristensen.EditorExtensions 5 | { 6 | public class FileTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy 7 | { 8 | public bool IsTransient(Exception ex) 9 | { 10 | return true; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EditorExtensions/Shared/Helpers/SourceMapNode.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MadsKristensen.EditorExtensions 3 | { 4 | public abstract class SourceMapNode 5 | { 6 | public string SourceFilePath { get; set; } 7 | public int GeneratedColumn { get; set; } 8 | public int OriginalColumn { get; set; } 9 | public int GeneratedLine { get; set; } 10 | public int OriginalLine { get; set; } 11 | 12 | public override bool Equals(object obj) 13 | { 14 | var node = (obj as SourceMapNode); 15 | 16 | return node.SourceFilePath == this.SourceFilePath && 17 | node.GeneratedColumn == this.GeneratedColumn && 18 | node.OriginalColumn == this.OriginalColumn && 19 | node.GeneratedLine == this.GeneratedLine && 20 | node.OriginalLine == this.OriginalLine; 21 | } 22 | 23 | public override int GetHashCode() 24 | { 25 | return this.SourceFilePath.GetHashCode() ^ 26 | this.GeneratedColumn ^ 27 | this.OriginalColumn ^ 28 | this.GeneratedLine ^ 29 | this.OriginalLine; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /EditorExtensions/Source.extension.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by Extensibility Tools v1.9.178 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace MadsKristensen.EditorExtensions 7 | { 8 | static class Vsix 9 | { 10 | public const string Id = "5fb7364d-2e8c-44a4-95eb-2a382e30fec9"; 11 | public const string Name = "Web Essentials 2015.3"; 12 | public const string Description = "Adds many useful features to Visual Studio for web developers. Requires Visual Studio 2015"; 13 | public const string Language = "en-US"; 14 | public const string Version = "3.0"; 15 | public const string Author = "Mads Kristensen"; 16 | public const string Tags = "css, javascript, html, json"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /EditorExtensions/Source.extension.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/EditorExtensions/Source.extension.ico -------------------------------------------------------------------------------- /EditorExtensions/Svg/ContentType/SvgContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.Svg 5 | { 6 | public class SvgContentTypeDefinition 7 | { 8 | public const string SvgContentType = "svg"; 9 | 10 | /// 11 | /// Exports the Svg HTML content type 12 | /// 13 | [Export(typeof(ContentTypeDefinition))] 14 | [Name(SvgContentType)] 15 | [BaseDefinition("htmlx")] 16 | public ContentTypeDefinition ISvgContentType { get; set; } 17 | 18 | [Export(typeof(FileExtensionToContentTypeDefinition))] 19 | [ContentType(SvgContentType)] 20 | [FileExtension(".svg")] 21 | public FileExtensionToContentTypeDefinition SvgFileExtension { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/Svg/Margin/SvgMargin.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | using MadsKristensen.EditorExtensions.Settings; 5 | using Microsoft.VisualStudio.Text; 6 | 7 | namespace MadsKristensen.EditorExtensions.Svg 8 | { 9 | internal class SvgMargin : DirectMarginBase 10 | { 11 | private WebBrowser _browser; 12 | 13 | public SvgMargin(ITextDocument document) 14 | : base(WESettings.Instance.General, document) 15 | { } 16 | 17 | protected override void UpdateMargin(string sourcePath) 18 | { 19 | if (_browser != null && File.Exists(sourcePath)) 20 | { 21 | _browser.Navigate(sourcePath); 22 | } 23 | } 24 | 25 | protected override FrameworkElement CreatePreviewControl() 26 | { 27 | _browser = new WebBrowser(); 28 | _browser.HorizontalAlignment = HorizontalAlignment.Stretch; 29 | return _browser; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /EditorExtensions/SweetJs/Commands/SweetJsCreationListener.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Editor; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using Microsoft.VisualStudio.TextManager.Interop; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.SweetJs 8 | { 9 | [Export(typeof(IVsTextViewCreationListener))] 10 | [ContentType(SweetJsContentTypeDefinition.SweetJsContentType)] 11 | [TextViewRole(PredefinedTextViewRoles.Document)] 12 | public class SweetJsCreationListener : IVsTextViewCreationListener 13 | { 14 | [Import] 15 | public IVsEditorAdaptersFactoryService EditorAdaptersFactoryService { get; set; } 16 | 17 | public void VsTextViewCreated(IVsTextView textViewAdapter) 18 | { 19 | var textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); 20 | 21 | textView.Properties.GetOrCreateSingletonProperty(() => new EnterIndentation(textViewAdapter, textView)); 22 | textView.Properties.GetOrCreateSingletonProperty(() => new CommentCommandTarget(textViewAdapter, textView, "//")); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /EditorExtensions/SweetJs/ContentType/SweetJsContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.SweetJs 5 | { 6 | public class SweetJsContentTypeDefinition 7 | { 8 | public const string SweetJsContentType = "sweetjs"; 9 | 10 | /// 11 | /// Exports the Sweet.js content type 12 | /// 13 | [Export(typeof(ContentTypeDefinition))] 14 | [Name(SweetJsContentType)] 15 | [BaseDefinition("JavaScript")] 16 | public ContentTypeDefinition ISweetJsContentType { get; set; } 17 | 18 | [Export(typeof(FileExtensionToContentTypeDefinition))] 19 | [ContentType(SweetJsContentType)] 20 | [FileExtension(".sjs")] 21 | public FileExtensionToContentTypeDefinition SweetJsFileExtension { get; set; } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /EditorExtensions/WebEssentials2015.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | false 10 | true 11 | true 12 | false 13 | true 14 | true 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | Resources\**.* 23 | -------------------------------------------------------------------------------- /EditorExtensions/WebEssentials2015.v2.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | false 10 | true 11 | true 12 | false 13 | true 14 | true 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | Resources\**.* 23 | -------------------------------------------------------------------------------- /EditorExtensions/WebVtt/Classify/WebVttClassifierProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Text; 3 | using Microsoft.VisualStudio.Text.Classification; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace MadsKristensen.EditorExtensions.WebVtt 7 | { 8 | [Export(typeof(IClassifierProvider))] 9 | [ContentType(WebVttContentTypeDefinition.WebVttContentType)] 10 | public class WebVttClassifierProvider : IClassifierProvider 11 | { 12 | [Import] 13 | public IClassificationTypeRegistryService Registry { get; set; } 14 | 15 | public IClassifier GetClassifier(ITextBuffer textBuffer) 16 | { 17 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new WebVttClassifier(Registry)); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /EditorExtensions/WebVtt/Commands/WebVttCreationListener.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Editor; 3 | using Microsoft.VisualStudio.Text.Editor; 4 | using Microsoft.VisualStudio.TextManager.Interop; 5 | using Microsoft.VisualStudio.Utilities; 6 | 7 | namespace MadsKristensen.EditorExtensions.WebVtt 8 | { 9 | [Export(typeof(IVsTextViewCreationListener))] 10 | [ContentType(WebVttContentTypeDefinition.WebVttContentType)] 11 | [TextViewRole(PredefinedTextViewRoles.Document)] 12 | public class WebVttViewCreationListener : IVsTextViewCreationListener 13 | { 14 | [Import] 15 | public IVsEditorAdaptersFactoryService EditorAdaptersFactoryService { get; set; } 16 | 17 | public void VsTextViewCreated(IVsTextView textViewAdapter) 18 | { 19 | var textView = EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); 20 | 21 | textView.Properties.GetOrCreateSingletonProperty(() => new CommentCommandTarget(textViewAdapter, textView, "NOTE ")); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /EditorExtensions/WebVtt/ContentType/WebVttContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace MadsKristensen.EditorExtensions.WebVtt 5 | { 6 | public class WebVttContentTypeDefinition 7 | { 8 | public const string WebVttContentType = "webvtt"; 9 | 10 | /// 11 | /// Exports the WebVTT HTML content type 12 | /// 13 | [Export(typeof(ContentTypeDefinition))] 14 | [Name(WebVttContentType)] 15 | [BaseDefinition("plaintext")] 16 | public ContentTypeDefinition IWebVttContentType { get; set; } 17 | 18 | [Export(typeof(FileExtensionToContentTypeDefinition))] 19 | [ContentType(WebVttContentType)] 20 | [FileExtension(".vtt")] 21 | public FileExtensionToContentTypeDefinition WebVttFileExtension { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /EditorExtensions/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015 Mads Kristensen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /WebEssentials2012logo.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/WebEssentials2012logo.pdn -------------------------------------------------------------------------------- /WebEssentialsTests/IntegrationTests/Completion/ZenCodingTest.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using System.Windows.Threading; 3 | using FluentAssertions; 4 | using MadsKristensen.EditorExtensions; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace WebEssentialsTests.IntegrationTests.Compilation 8 | { 9 | [TestClass] 10 | public class ZenCodingTest 11 | { 12 | [HostType("VS IDE")] 13 | [TestMethod, TestCategory("Completion")] 14 | public async Task HtmlZenCodingTest() 15 | { 16 | var textView = await VSHost.TypeText(".html", "#id.class\t"); 17 | await VSHost.Dispatcher.NextFrame(DispatcherPriority.ApplicationIdle); 18 | textView.GetText().Should().Be("
"); 19 | } 20 | 21 | [HostType("VS IDE")] 22 | //[TestMethod, TestCategory("Completion")] 23 | public async Task AspxZenCodingTest() 24 | { 25 | var textView = await VSHost.TypeText(".aspx", "#id.class\t"); 26 | await VSHost.Dispatcher.NextFrame(DispatcherPriority.ApplicationIdle); 27 | textView.GetText().Should().Be("
"); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /WebEssentialsTests/Tests/IntellisenseGeneration/TestHelper/IntellisenseObjectsAssertionsExtensions.cs: -------------------------------------------------------------------------------- 1 | using MadsKristensen.EditorExtensions; 2 | 3 | namespace WebEssentialsTests.Tests.IntellisenseGeneration.TestHelper 4 | { 5 | public static class IntellisenseObjectsAssertionsExtensions 6 | { 7 | public static IntellisenseObjectsAssertions Should(this IntellisenseObject @object) 8 | { 9 | return new IntellisenseObjectsAssertions(@object); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /WebEssentialsTests/WebEssentialsTests.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | true 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | true 10 | true 11 | true 12 | false 13 | true 14 | false 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | ..\EditorExtensions\Resources\**.* 23 | -------------------------------------------------------------------------------- /WebEssentialsTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/.gitignore: -------------------------------------------------------------------------------- 1 | !packages/ 2 | !node_modules -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/CodeGen.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.20930.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGen", "CodeGen.csproj", "{9B43DABC-6854-427D-A995-4B2A90A31442}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9B43DABC-6854-427D-A995-4B2A90A31442}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9B43DABC-6854-427D-A995-4B2A90A31442}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9B43DABC-6854-427D-A995-4B2A90A31442}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9B43DABC-6854-427D-A995-4B2A90A31442}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/CollectionModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace Lib.Generation 5 | { 6 | public class CollectionModel 7 | { 8 | public string[] AStringArray { get; set; } 9 | public IEnumerable AStringIEnumerable { get; set; } 10 | public ICollection AStringICollection { get; set; } 11 | public IList AStringIList { get; set; } 12 | public List AStringList { get; set; } 13 | public Collection AStringCollection { get; set; } 14 | public List ASimpleList { get; set; } 15 | public List ALongList { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/CollectionModel.cs.d.ts: -------------------------------------------------------------------------------- 1 | declare module server { 2 | interface CollectionModel { 3 | AStringArray: string[]; 4 | AStringIEnumerable: string[]; 5 | AStringICollection: string[]; 6 | AStringIList: string[]; 7 | AStringList: string[]; 8 | AStringCollection: string[]; 9 | ASimpleList: server.Simple[]; 10 | ALongList: number[]; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/Simple.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lib.Generation 4 | { 5 | public class Simple 6 | { 7 | public Simple ASimple { get; set; } 8 | public string AString { get; set; } 9 | public bool ABool { get; set; } 10 | public int AnInt { get; set; } 11 | public DateTime ADateTime { get; set; } 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/Simple.cs.d.ts: -------------------------------------------------------------------------------- 1 | declare module server { 2 | interface Simple { 3 | ASimple: server.Simple; 4 | AString: string; 5 | ABool: boolean; 6 | AnInt: number; 7 | ADateTime: Date; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/Simple.cs.js: -------------------------------------------------------------------------------- 1 | var server = server || {}; 2 | /// The Simple class as defined in Lib.Generation.Simple 3 | server.Simple = function() { 4 | /// The ASimple property as defined in Lib.Generation.Simple 5 | this.ASimple = { }; 6 | /// The AString property as defined in Lib.Generation.Simple 7 | this.AString = ''; 8 | /// The ABool property as defined in Lib.Generation.Simple 9 | this.ABool = false; 10 | /// The AnInt property as defined in Lib.Generation.Simple 11 | this.AnInt = 0; 12 | /// The ADateTime property as defined in Lib.Generation.Simple 13 | this.ADateTime = new Date(); 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/SimpleNullable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lib.Generation 4 | { 5 | public class SimpleNullable 6 | { 7 | public bool? ABool { get; set; } 8 | public int? AnInt { get; set; } 9 | 10 | public DateTime? ADateTime { get; set; } 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/SimpleNullable.cs.d.ts: -------------------------------------------------------------------------------- 1 | declare module server { 2 | interface SimpleNullable { 3 | ABool: boolean; 4 | AnInt: number; 5 | ADateTime: Date; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/CodeGen/Generation/SimpleNullable.cs.js: -------------------------------------------------------------------------------- 1 | var server = server || {}; 2 | /// The SimpleNullable class as defined in Lib.Generation.SimpleNullable 3 | server.SimpleNullable = function() { 4 | /// The ABool property as defined in Lib.Generation.SimpleNullable 5 | this.ABool = false; 6 | /// The AnInt property as defined in Lib.Generation.SimpleNullable 7 | this.AnInt = 0; 8 | /// The ADateTime property as defined in Lib.Generation.SimpleNullable 9 | this.ADateTime = new Date(); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LegacySettings/LegacySettings.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{368FA187-5CD4-4FAE-82EC-DDF2F14412AC}" 7 | ProjectSection(SolutionItems) = preProject 8 | WE2013-settings.xml = WE2013-settings.xml 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionProperties) = preSolution 13 | HideSolutionNode = FALSE 14 | EndGlobalSection 15 | EndGlobal 16 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LessDependencies/Areas/Manager.less: -------------------------------------------------------------------------------- 1 | @import '_admin.less'; 2 | 3 | body { 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LessDependencies/Areas/_admin.less: -------------------------------------------------------------------------------- 1 | @import '../_shared.less'; 2 | 3 | body { 4 | background: red; 5 | } 6 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LessDependencies/Home.less: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | @import '_shared.less'; -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LessDependencies/LessDependencies.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LessDependencies", "LessDependencies.csproj", "{C0EC1DA0-F8F5-4CF9-A241-FBC8D7D99853}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C0EC1DA0-F8F5-4CF9-A241-FBC8D7D99853}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C0EC1DA0-F8F5-4CF9-A241-FBC8D7D99853}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C0EC1DA0-F8F5-4CF9-A241-FBC8D7D99853}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C0EC1DA0-F8F5-4CF9-A241-FBC8D7D99853}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/LessDependencies/_shared.less: -------------------------------------------------------------------------------- 1 | @import url('https://google.com/stuff.css'); 2 | body { 3 | } 4 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/ProjectEnumeration/CPP-Normal/CPP-Normal.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/ProjectEnumeration/CPP-WinStore/CPP-WinStore.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 03ab1342-320a-4162-92d5-7a1ecc9c86f9 6 | 7 | 8 | c278f0ac-1dee-47f6-981e-a9c833ca4bbb 9 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/ProjectEnumeration/Web-Normal/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/Visual Studio/ProjectEnumeration/Website-Project/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/coffee/compiled/test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | this.isAvailable = function(type, value) { 3 | var deferred; 4 | deferred = $q.defer(); 5 | $http.get(prApiRoot + "users/available?" + type + "=" + value).success(function(data) { 6 | deferred.resolve(data); 7 | }).error(function(data, status) { 8 | deferred.reject({ 9 | data: data, 10 | status: status 11 | }); 12 | }); 13 | return deferred.promise; 14 | }; 15 | 16 | }).call(this); 17 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/coffee/source/test.coffee: -------------------------------------------------------------------------------- 1 | this.isAvailable = (type, value) -> 2 | deferred = $q.defer() 3 | 4 | $http.get(prApiRoot + "users/available?" + type + "=" + value) 5 | .success((data) -> 6 | deferred.resolve(data) 7 | return 8 | ).error((data, status) -> 9 | deferred.reject({ data: data, status: status}) 10 | return 11 | ) 12 | return deferred.promise -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/coffee/source/test.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.6.3 2 | (function() { 3 | this.isAvailable = function(type, value) { 4 | var deferred; 5 | deferred = $q.defer(); 6 | $http.get(prApiRoot + "users/available?" + type + "=" + value).success(function(data) { 7 | deferred.resolve(data); 8 | }).error(function(data, status) { 9 | deferred.reject({ 10 | data: data, 11 | status: status 12 | }); 13 | }); 14 | return deferred.promise; 15 | }; 16 | 17 | }).call(this); 18 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/handlebars/source/test.hbs: -------------------------------------------------------------------------------- 1 | 
2 |

{{hello}}

3 |
4 | {{world}} 5 |
6 | {{#if hello}} 7 |

Hello

8 | {{/if}} 9 | {{customHander hello}} 10 |
11 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/iced/source/test.iced: -------------------------------------------------------------------------------- 1 | this.isAvailable = (type, value) -> 2 | deferred = $q.defer() 3 | 4 | $http.get(prApiRoot + "users/available?" + type + "=" + value) 5 | .success((data) -> 6 | deferred.resolve(data) 7 | return 8 | ).error((data, status) -> 9 | deferred.reject({ data: data, status: status}) 10 | return 11 | ) 12 | return deferred.promise -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/jshint/.jshintignore: -------------------------------------------------------------------------------- 1 | skip.js -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/jshint/config/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "eqeqeq" : false, // true: Require triple equals (===) for comparison 3 | "undef" : false // true: Require all non-global variables to be declared (prevents global leaks) 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/jshint/config/clean.js: -------------------------------------------------------------------------------- 1 | undef1 = undef2 == undef3; -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/jshint/default.js: -------------------------------------------------------------------------------- 1 | undef1 = undef2 == undef3; 2 | var unused; -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/jshint/skip.js: -------------------------------------------------------------------------------- 1 | undef1 = undef2 == undef3; -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/URLs.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(http://slaks.net/Images/Icons/Me.png), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC"), url(//developer.cdn.mozilla.net/media/img/mdn-logo-sm.png), url(css/MyImage.png); 3 | } 4 | .background-gradient { 5 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 6 | } 7 | @media print { 8 | .custom-anchor { 9 | text-decoration: none; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/URLs.less: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(http://slaks.net/Images/Icons/Me.png), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC"), url(//developer.cdn.mozilla.net/media/img/mdn-logo-sm.png), url(css/MyImage.png); 3 | } 4 | 5 | .background-gradient { 6 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 7 | } 8 | 9 | @media print { 10 | .custom-anchor { 11 | text-decoration: none; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/_Deep Inclusion.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(sub1/deeper/deep-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | .background-gradient { 6 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 7 | } 8 | @media screen { 9 | body { 10 | width: 75%; 11 | } 12 | } 13 | @media print { 14 | body { 15 | width: 100%; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/_Deep Inclusion.less: -------------------------------------------------------------------------------- 1 | @import 'sub1/deeper/_lib.less'; 2 | 3 | 4 | .background-gradient { 5 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 6 | } 7 | 8 | @media screen { 9 | body { 10 | width: 75%; 11 | } 12 | } 13 | @media print { 14 | body { 15 | width: 100%; 16 | } 17 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/_Entry1.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/_Entry1.less: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/css/URLs.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(http://slaks.net/Images/Icons/Me.png), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC"), url(//developer.cdn.mozilla.net/media/img/mdn-logo-sm.png), url(MyImage.png); 3 | } 4 | .background-gradient { 5 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 6 | } 7 | @media print { 8 | .custom-anchor { 9 | text-decoration: none; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/css/_Deep Inclusion.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../sub1/deeper/deep-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | .background-gradient { 6 | background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Q1ZWRmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE0JSIgc3RvcC1jb2xvcj0iIzM0OWFlNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iIzE0N2FkNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxOGI2ZTUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); 7 | } 8 | @media screen { 9 | body { 10 | width: 75%; 11 | } 12 | } 13 | @media print { 14 | body { 15 | width: 100%; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/css/_Entry1.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/_Entry2.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | b { 6 | background: url(../base-image.png); 7 | } 8 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/_Entry2.less: -------------------------------------------------------------------------------- 1 | @import '../_Entry1.less'; 2 | b { 3 | background: url(../base-image.png); 4 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/css/_Entry2.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../../base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | b { 6 | background: url(../../base-image.png); 7 | } 8 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/_Entry3.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../../base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | b { 6 | background: url(deep-image.png); 7 | } 8 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/_Entry3.less: -------------------------------------------------------------------------------- 1 | @import '../../_Entry1.less'; 2 | b { 3 | background: url(deep-image.png); 4 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/_lib.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(deep-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/_lib.less: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(deep-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/css/_Entry3.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../../../base-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | b { 6 | background: url(../deep-image.png); 7 | } 8 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/less/sub1/deeper/css/_lib.css: -------------------------------------------------------------------------------- 1 | a { 2 | background: url(../deep-image.png); 3 | background: url(/absolute/path/to/image.png); 4 | } 5 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/b/d.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error('load fixtures/b/d.js'); 23 | 24 | var string = 'D'; 25 | 26 | exports.D = function() { 27 | return string; 28 | }; 29 | 30 | process.on('exit', function() { 31 | string = 'D done'; 32 | }); 33 | 34 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/b/package/index.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | exports.hello = 'world'; 23 | console.error('load package/index.js'); 24 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/cycles/folder/foo.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | var root = require('./../root'); 24 | 25 | exports.hello = function() { 26 | return root.calledFromFoo(); 27 | }; 28 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/cycles/root.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | var foo = exports.foo = require('./folder/foo'); 24 | 25 | exports.hello = 'hello'; 26 | exports.sayHello = function() { 27 | return foo.hello(); 28 | }; 29 | exports.calledFromFoo = function() { 30 | return exports.hello; 31 | }; 32 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/empty/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/WebEssentialsTests/fixtures/module-resolution/empty/.gitkeep -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/foo: -------------------------------------------------------------------------------- 1 | 2 | exports.foo = "ok" 3 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/global/plain.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | foo = 'foo'; 23 | global.bar = 'bar'; 24 | 25 | exports.fooBar = {foo: global.foo, bar: bar}; 26 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/one/hello.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | exports.hello = 'hello from one!'; 23 | 24 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/one/index.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | exports.hello = require('./hello').hello; 23 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/three.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/three/index.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/two/hello.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | exports.hello = 'hello from two!'; 23 | 24 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/nested-index/two/index.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | exports.hello = require('./hello').hello; 23 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/asdf.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error(__filename); 23 | console.error(module.paths.join('\n') + '\n'); 24 | throw new Error('Should not ever get here.'); 25 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/bar.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error(__filename); 23 | console.error(module.paths.join('\n') + '\n'); 24 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/baz/node_modules/asdf.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error(__filename); 23 | console.error(module.paths.join('\n') + '\n'); 24 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/baz/otherFile.js: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/foo.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error(__filename); 23 | console.error(module.paths.join('\n') + '\n'); 24 | var assert = require('assert'); 25 | assert.equal(require('baz'), require('./baz/index.js')); 26 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/module-resolution/node_modules/node_modules/bar.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | console.error(__filename); 23 | console.error(module.paths.join('\n') + '\n'); 24 | throw new Error('Should not ever get here.'); 25 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/scss/extend.css: -------------------------------------------------------------------------------- 1 | .message, .success, .error, .warning { 2 | border: 1px solid #ccc; 3 | padding: 10px; 4 | color: #333; } 5 | 6 | .success { 7 | border-color: green; } 8 | 9 | .error { 10 | border-color: red; } 11 | 12 | .warning { 13 | border-color: yellow; } 14 | -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/scss/extend.scss: -------------------------------------------------------------------------------- 1 | .message { 2 | border: 1px solid #ccc; 3 | padding: 10px; 4 | color: #333; 5 | } 6 | 7 | .success { 8 | @extend .message; 9 | border-color: green; 10 | } 11 | 12 | .error { 13 | @extend .message; 14 | border-color: red; 15 | } 16 | 17 | .warning { 18 | @extend .message; 19 | border-color: yellow; 20 | } -------------------------------------------------------------------------------- /WebEssentialsTests/fixtures/sweet.js/compiled/test.js: -------------------------------------------------------------------------------- 1 | 42; 2 | // Note that a single token to sweet.js includes matched 3 | // delimiters not just numbers and identifiers. For example, 4 | // an array with all of its elements counts as one token: 5 | [ 6 | 1, 7 | 2, 8 | 3 9 | ]; 10 | // One of the really important things sweet.js does is protect 11 | // macros from unintentionally binding or capturing variables they 12 | // weren't supposed to. This is called hygiene and to enforce hygiene 13 | // sweet.js must carefully rename all variable names. 14 | var x$295; 15 | var foo$321 = 100; 16 | var bar$322 = 200; 17 | var tmp$323 = 'my other temporary variable'; 18 | var tmp$325 = bar$322; 19 | bar$322 = foo$321; 20 | foo$321 = tmp$325; -------------------------------------------------------------------------------- /WebEssentialsTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ZenCoding.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/ZenCoding.dll -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | os: Visual Studio 2015 3 | 4 | install: 5 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex 6 | 7 | before_build: 8 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion 9 | - ps: Vsix-TokenReplacement EditorExtensions\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 10 | 11 | build_script: 12 | - nuget restore -Verbosity quiet 13 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 14 | 15 | after_test: 16 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery 17 | 18 | before_deploy: 19 | - ps: Vsix-CreateChocolatyPackage -packageId webessentials2015 20 | 21 | deploy: 22 | - provider: Environment 23 | name: Chocolatey 24 | on: 25 | branch: master 26 | appveyor_repo_commit_message_extended: /\[release\]/ -------------------------------------------------------------------------------- /assemblies/Microsoft.CSS.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.CSS.Core.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.CSS.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.CSS.Editor.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.Html.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.Html.Core.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.Html.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.Html.Editor.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.JSON.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.JSON.Core.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.JSON.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.JSON.Editor.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.VisualStudio.Html.Package.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.VisualStudio.Html.Package.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.VisualStudio.JSON.Package.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.VisualStudio.JSON.Package.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.VisualStudio.ProjectSystem.Utilities.v14.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.VisualStudio.ProjectSystem.Utilities.v14.0.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.VisualStudio.Web.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.VisualStudio.Web.Extensions.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.VisualStudio.Web.ProjectSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.VisualStudio.Web.ProjectSystem.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.Web.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.Web.Core.dll -------------------------------------------------------------------------------- /assemblies/Microsoft.Web.Editor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/assemblies/Microsoft.Web.Editor.dll -------------------------------------------------------------------------------- /nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/WebEssentials2015/9a9eaa4455f9b146981252d7b03e45db3adf34ce/nuget.exe --------------------------------------------------------------------------------