You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensibility/internals/best-practices-for-security-in-vspackages.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,17 @@ manager: douge
16
16
ms.workload:
17
17
- "vssdk"
18
18
---
19
-
# Best Practices for Security in VSPackages
20
-
To install the [!INCLUDE[vsipsdk](../../extensibility/includes/vsipsdk_md.md)] on your computer, you must be running in a context with administrative credentials. The basic unit of security and deployment of a [!INCLUDE[vsprvs](../../code-quality/includes/vsprvs_md.md)] application is the [VSPackages](../../extensibility/internals/vspackages.md). A VSPackage must be registered by using [!INCLUDE[vsprvs](../../code-quality/includes/vsprvs_md.md)], which also requires administrative credentials.
19
+
# Best practices for security in VSPackages
20
+
To install the [!INCLUDE[vsipsdk](../../extensibility/includes/vsipsdk_md.md)] on your computer, you must be running in a context with administrative credentials. The basic unit of security and deployment of a [!INCLUDE[vsprvs](../../code-quality/includes/vsprvs_md.md)] application is the [VSPackage](../../extensibility/internals/vspackages.md). A VSPackage must be registered by using [!INCLUDE[vsprvs](../../code-quality/includes/vsprvs_md.md)], which also requires administrative credentials.
21
21
22
22
Administrators have full permissions to write to the registry and file system, and to run any code. You must have these permissions to develop, deploy, or install a VSPackage.
23
23
24
24
As soon as it is installed, a VSPackage is fully trusted. Because of this high level of permission associated with a VSPackage, it is possible to inadvertently install a VSPackage that has malicious intent.
25
25
26
26
Users should ensure that they install VSPackages only from trusted sources. Companies developing VSPackages should strongly name and sign them, to assure the user that tampering is prevented. Companies developing VSPackages should examine their external dependencies, such as web services and remote installation, to evaluate and correct any security issues.
27
27
28
-
For more information, see Secure Coding Guidelines for the .NET Framework ([http://msdn.microsoft.com/library/d55zzx87.aspx](http://msdn.microsoft.com/library/d55zzx87.aspx)).
28
+
For more information, see [Secure coding guidelines for the .NET Framework](http://msdn.microsoft.com/library/d55zzx87.aspx).
Copy file name to clipboardExpand all lines: docs/extensibility/internals/brace-matching-in-a-legacy-language-service.md
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,12 @@ manager: douge
15
15
ms.workload:
16
16
- "vssdk"
17
17
---
18
-
# Brace Matching in a Legacy Language Service
18
+
# Brace matching in a legacy language service
19
19
Brace matching helps the developer track language elements that need to occur together, such as parentheses and curly braces. When a developer enters a closing brace, the opening brace is highlighted.
20
20
21
-
You can match two or three co-occurring elements, called pairs and triples. Triples are sets of three co-occurring elements. For example, in C#, the `foreach` statement forms a triple: "`foreach()`", "`{`", and "`}`". All three elements are highlighted when the closing brace is typed.
21
+
You can match two or three co-occurring elements, called pairs and triples. Triples are sets of three co-occurring elements. For example, in C#, the `foreach` statement forms a triple: `foreach()`, `{`, and `}`. All three elements are highlighted when the closing brace is typed.
22
22
23
-
Legacy language services are implemented as part of a VSPackage, but the newer way to implement language service features is to use MEF extensions. To find out more about the new way to implement brace matching, see [Walkthrough: Displaying Matching Braces](../../extensibility/walkthrough-displaying-matching-braces.md).
23
+
Legacy language services are implemented as part of a VSPackage, but the newer way to implement language service features is to use MEF extensions. To find out more about the new way to implement brace matching, see [Walkthrough: Display matching braces](../../extensibility/walkthrough-displaying-matching-braces.md).
24
24
25
25
> [!NOTE]
26
26
> We recommend that you begin to use the new editor API as soon as possible. This will improve the performance of your language service and let you take advantage of new editor features.
@@ -32,22 +32,22 @@ Brace matching helps the developer track language elements that need to occur to
32
32
33
33
The <xref:Microsoft.VisualStudio.Package.Source.OnCommand%2A> method calls the scanner to tokenize the line and return the token just before the caret. The scanner indicates that a language element pair has been found by setting a token trigger value of <xref:Microsoft.VisualStudio.Package.TokenTriggers> on the current token. The <xref:Microsoft.VisualStudio.Package.Source.OnCommand%2A> method calls the <xref:Microsoft.VisualStudio.Package.Source.MatchBraces%2A> method that in turn calls the <xref:Microsoft.VisualStudio.Package.LanguageService.BeginParse%2A> method with the parse reason value of <xref:Microsoft.VisualStudio.Package.ParseReason> to locate the matching language element. When the matching language element is found, both elements are highlighted.
34
34
35
-
For a complete description of how typing a brace triggers the brace highlighting, see the "Example Parse Operation" section in the topic[Legacy Language Service Parser and Scanner](../../extensibility/internals/legacy-language-service-parser-and-scanner.md).
35
+
For a complete description of how typing a brace triggers the brace highlighting, see the *Example parse operation* section in the article[Legacy language service parser and scanner](../../extensibility/internals/legacy-language-service-parser-and-scanner.md).
36
36
37
-
## Enabling Support for Brace Matching
38
-
The <xref:Microsoft.VisualStudio.Shell.ProvideLanguageServiceAttribute> attribute can set the `MatchBraces`, `MatchBracesAtCaret`, and `ShowMatchingBrace` named parameters that set the corresponding properties of the <xref:Microsoft.VisualStudio.Package.LanguagePreferences> class. Language preference properties can also be set by the user.
37
+
## Enable support for brace matching
38
+
The <xref:Microsoft.VisualStudio.Shell.ProvideLanguageServiceAttribute> attribute can set the **MatchBraces**, **MatchBracesAtCaret**, and **ShowMatchingBrace** registry entries that set the corresponding properties of the <xref:Microsoft.VisualStudio.Package.LanguagePreferences> class. Language preference properties can also be set by the user.
|`MatchBracesAtCaret`|<xref:Microsoft.VisualStudio.Package.LanguagePreferences.EnableMatchBracesAtCaret%2A>|Enables brace matching as the caret moves.|
44
-
|`ShowMatchingBrace`|<xref:Microsoft.VisualStudio.Package.LanguagePreferences.EnableShowMatchingBrace%2A>|Highlights the matching brace.|
|MatchBracesAtCaret|<xref:Microsoft.VisualStudio.Package.LanguagePreferences.EnableMatchBracesAtCaret%2A>|Enables brace matching as the caret moves.|
44
+
|ShowMatchingBrace|<xref:Microsoft.VisualStudio.Package.LanguagePreferences.EnableShowMatchingBrace%2A>|Highlights the matching brace.|
45
45
46
-
## Matching Conditional Statements
46
+
## Match conditional statements
47
47
You can match conditional statements, such as `if`, `else if`, and `else`, or `#if`, `#elif`, `#else`, `#endif`, in the same way as matching delimiters. You can subclass the <xref:Microsoft.VisualStudio.Package.AuthoringSink> class and provide a method that can add text spans as well as delimiters to the internal array of matching elements.
48
48
49
-
## Setting the Trigger
50
-
The following example shows how to detect matching parentheses, curly braces and square braces, and setting the trigger for it in the scanner. The <xref:Microsoft.VisualStudio.Package.Source.OnCommand%2A> method on the <xref:Microsoft.VisualStudio.Package.Source> class detects the trigger and calls the parser to find the matching pair (see the "Finding the Match" section in this topic). This example is for illustrative purposes only. It assumes that your scanner contains a method `GetNextToken` that identifies and returns tokens from a line of text.
49
+
## Set the trigger
50
+
The following example shows how to detect matching parentheses, curly braces and square braces, and setting the trigger for it in the scanner. The <xref:Microsoft.VisualStudio.Package.Source.OnCommand%2A> method on the <xref:Microsoft.VisualStudio.Package.Source> class detects the trigger and calls the parser to find the matching pair (see the *Finding the match* section in this article). This example is for illustrative purposes only. It assumes that your scanner contains a method `GetNextToken` that identifies and returns tokens from a line of text.
51
51
52
52
```csharp
53
53
usingMicrosoft.VisualStudio.Package;
@@ -81,8 +81,8 @@ namespace TestLanguagePackage
81
81
}
82
82
```
83
83
84
-
## Matching the Braces
85
-
Here is a simplified example for matching the languageelements { }, ( ), and [ ], and adding their spans to the <xref:Microsoft.VisualStudio.Package.AuthoringSink> object. This approach is not a recommended approach to parsing sourcecode; it is for illustrative purposes only.
84
+
## Match the braces
85
+
Here is a simplified example for matching the language elements `{ }`, `( )`, and `[ ]`, and adding their spans to the <xref:Microsoft.VisualStudio.Package.AuthoringSink> object. This approach is not a recommended approach to parsing source code; it is for illustrative purposes only.
86
86
87
87
```csharp
88
88
usingMicrosoft.VisualStudio.Package;
@@ -132,6 +132,6 @@ namespace TestLanguagePackage
132
132
}
133
133
```
134
134
135
-
## See Also
136
-
[Legacy Language Service Features](../../extensibility/internals/legacy-language-service-features1.md)
137
-
[Legacy Language Service Parser and Scanner](../../extensibility/internals/legacy-language-service-parser-and-scanner.md)
Copy file name to clipboardExpand all lines: docs/extensibility/internals/catids-for-objects-that-are-typically-used-to-extend-projects.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@ manager: douge
16
16
ms.workload:
17
17
- "vssdk"
18
18
---
19
-
# CATIDs for Objects That Are Typically Used to Extend Projects
20
-
The following table lists CATIDs that are used to extend `Project` and `ProjectItem` automation objects for [!INCLUDE[vbprvb](../../code-quality/includes/vbprvb_md.md)], [!INCLUDE[csprcs](../../data-tools/includes/csprcs_md.md)], and [!INCLUDE[vcprvc](../../code-quality/includes/vcprvc_md.md)] projects. These CATIDs are defined in VSLangProj.olb.
19
+
# CATIDs for objects that are typically used to extend projects
20
+
The following table lists CATIDs that are used to extend `Project` and `ProjectItem` automation objects for [!INCLUDE[vbprvb](../../code-quality/includes/vbprvb_md.md)], [!INCLUDE[csprcs](../../data-tools/includes/csprcs_md.md)], and [!INCLUDE[vcprvc](../../code-quality/includes/vcprvc_md.md)] projects. These CATIDs are defined in *VSLangProj.olb*.
21
21
22
22
## Listing of CATIDs
23
23
@@ -27,7 +27,7 @@ The following table lists CATIDs that are used to extend `Project` and `ProjectI
The following table lists CATIDs that are used to extend [!INCLUDE[vbprvb](../../code-quality/includes/vbprvb_md.md)] browse objects. They are all defined in VSLangProj.olb.
30
+
The following table lists CATIDs that are used to extend [!INCLUDE[vbprvb](../../code-quality/includes/vbprvb_md.md)] browse objects. They are all defined in *VSLangProj.olb*.
31
31
32
32
|Name|GUID|
33
33
|----------|----------|
@@ -38,7 +38,7 @@ The following table lists CATIDs that are used to extend `Project` and `ProjectI
The following CATIDs can be used to extend [!INCLUDE[csprcs](../../data-tools/includes/csprcs_md.md)] browse objects. They are all defined in VSLangProj.olb.
41
+
The following CATIDs can be used to extend [!INCLUDE[csprcs](../../data-tools/includes/csprcs_md.md)] browse objects. They are all defined in *VSLangProj.olb*.
0 commit comments