Skip to content

Commit f3d6cf0

Browse files
committed
Merge pull request #156 from tomasr/develop
v3.2 release
2 parents 5485c63 + b9bc207 commit f3d6cf0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+674
-352
lines changed

src/Viasfora.Core/Constants.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ public static class Constants {
1414

1515
public const String OBFUSCATED_TEXT = "viasfora.text.obfuscated";
1616

17-
public const String CT_XML = "XML";
18-
public const String CT_XAML = "XAML";
19-
public const String CT_HTML = "HTML";
20-
// VS213 HTML Editor
21-
public const String CT_HTMLX = "htmlx";
22-
public const String XML_CLOSING = "XMLCloseTag";
23-
public const String XML_PREFIX = "XMLPrefix";
24-
public const String XML_CLOSING_PREFIX = "viasfora.xml.closing.prefix";
25-
public const String RAZOR_CLOSING = "viasfora.razor.closing.element";
26-
// I'd prefer "XML Delimiter" here, but no way to
27-
// use it effectively.
28-
public const String DELIMITER = PredefinedClassificationTypeNames.Operator;
29-
3017
public const String STRING_COLLECTION_EDITOR = "System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
3118
public static int S_OK = 0;
3219

src/Viasfora.Core/Text/CurrentColumnAdornmentFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Winterdom.Viasfora.Text {
88

99
[Export(typeof(IWpfTextViewCreationListener))]
1010
[ContentType(ContentTypes.Text)]
11-
[TextViewRole(PredefinedTextViewRoles.Interactive)]
11+
[TextViewRole(PredefinedTextViewRoles.Editable)]
1212
internal sealed class CurrentColumnAdornmentFactory : IWpfTextViewCreationListener {
1313
[Import]
1414
public IClassificationTypeRegistryService ClassificationRegistry = null;

src/Viasfora.Core/Text/CurrentLineAdornmentFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Winterdom.Viasfora.Text {
88

99
[Export(typeof(IWpfTextViewCreationListener))]
1010
[ContentType(ContentTypes.Text)]
11-
[TextViewRole(PredefinedTextViewRoles.Interactive)]
11+
[TextViewRole(PredefinedTextViewRoles.Editable)]
1212
internal sealed class CurrentLineAdornmentFactory : IWpfTextViewCreationListener {
1313
[Import]
1414
public IClassificationTypeRegistryService ClassificationRegistry = null;

src/Viasfora.Languages/BraceScanners/CSharpBraceScanner.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ private bool ParseInterpolatedString(ITextChars tc, ref CharPos pos) {
213213
pos = new CharPos(tc.Char(), tc.AbsolutePosition, EncodedState());
214214
tc.Next();
215215
return true;
216+
} else if ( this.multiLine && tc.Char() == '"' && tc.NChar() == '"' ) {
217+
// single embedded double quote
218+
tc.Skip(2);
216219
} else if ( tc.Char() == '"' ) {
217220
// done parsing the interpolated string
218221
this.status = stText;

src/Viasfora.Languages/CBasedLanguage.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ public abstract class CBasedLanguage : LanguageInfo {
99

1010
public CBasedLanguage(IVsfSettings settings) : base(settings) {
1111
}
12-
protected override IBraceScanner NewBraceScanner() {
13-
return new CBraceScanner();
14-
}
15-
public override IStringScanner NewStringScanner(String text) {
16-
return new BasicCStringScanner(text);
17-
}
12+
protected override IBraceScanner NewBraceScanner()
13+
=> new CBraceScanner();
14+
public override IStringScanner NewStringScanner(String text)
15+
=> new BasicCStringScanner(text);
1816
}
1917
}

src/Viasfora.Languages/CSharp.cs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,17 @@ public class CSharp : CBasedLanguage {
2323
static readonly String[] CS_VIS_KEYWORDS = {
2424
"public", "private", "protected", "internal"
2525
};
26-
protected override String[] ControlFlowDefaults {
27-
get { return CS_KEYWORDS; }
28-
}
29-
protected override String[] LinqDefaults {
30-
get { return CS_LINQ_KEYWORDS; }
31-
}
32-
protected override String[] VisibilityDefaults {
33-
get { return CS_VIS_KEYWORDS; }
34-
}
35-
public override String KeyName {
36-
get { return Constants.CSharp; }
37-
}
38-
protected override String[] SupportedContentTypes {
39-
get { return new String[] { ContentType }; }
40-
}
26+
protected override String[] ControlFlowDefaults => CS_KEYWORDS;
27+
protected override String[] LinqDefaults => CS_LINQ_KEYWORDS;
28+
protected override String[] VisibilityDefaults => CS_VIS_KEYWORDS;
29+
public override String KeyName => Constants.CSharp;
30+
protected override String[] SupportedContentTypes
31+
=> new String[] { ContentType };
4132

42-
protected override IBraceScanner NewBraceScanner() {
43-
return new CSharpBraceScanner();
44-
}
45-
public override IStringScanner NewStringScanner(string text) {
46-
return new CSharpStringScanner(text);
47-
}
33+
protected override IBraceScanner NewBraceScanner()
34+
=> new CSharpBraceScanner();
35+
public override IStringScanner NewStringScanner(string text)
36+
=> new CSharpStringScanner(text);
4837

4938
[ImportingConstructor]
5039
public CSharp(IVsfSettings settings) : base(settings) {

src/Viasfora.Languages/Cpp.cs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,19 @@ class Cpp : CBasedLanguage {
1515
static readonly String[] CPP_VIS_KEYWORDS = {
1616
"public", "private", "protected", "internal", "friend"
1717
};
18-
protected override String[] ControlFlowDefaults {
19-
get { return CPP_KEYWORDS; }
20-
}
21-
protected override String[] LinqDefaults {
22-
get { return new String[0]; }
23-
}
24-
protected override String[] VisibilityDefaults {
25-
get { return CPP_VIS_KEYWORDS; }
26-
}
27-
public override String KeyName {
28-
get { return Constants.Cpp; }
29-
}
30-
protected override String[] SupportedContentTypes {
31-
get { return new String[] { ContentType }; }
32-
}
18+
protected override String[] ControlFlowDefaults => CPP_KEYWORDS;
19+
protected override String[] LinqDefaults => EMPTY;
20+
protected override String[] VisibilityDefaults => CPP_VIS_KEYWORDS;
21+
public override String KeyName => Constants.Cpp;
22+
23+
protected override String[] SupportedContentTypes
24+
=> new String[] { ContentType };
3325

3426
[ImportingConstructor]
3527
public Cpp(IVsfSettings settings) : base(settings) {
3628
}
3729

38-
public override IStringScanner NewStringScanner(string text) {
39-
return new CStringScanner(text);
40-
}
30+
public override IStringScanner NewStringScanner(string text)
31+
=> new CStringScanner(text);
4132
}
4233
}

src/Viasfora.Languages/Css.cs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,22 @@ public class Css : LanguageInfo {
1313
public const String SassContentType = "SCSS";
1414
public const String LessContentType = "LESS";
1515

16-
public override String KeyName {
17-
get { return Constants.Css; }
18-
}
16+
public override String KeyName => Constants.Css;
17+
1918
protected override String[] SupportedContentTypes {
2019
get { return new String[] { ContentType, SassContentType, LessContentType }; }
2120
}
22-
protected override String[] ControlFlowDefaults {
23-
get { return EMPTY; }
24-
}
25-
protected override String[] LinqDefaults {
26-
get { return EMPTY; }
27-
}
28-
protected override String[] VisibilityDefaults {
29-
get { return EMPTY; }
30-
}
21+
protected override String[] ControlFlowDefaults => EMPTY;
22+
protected override String[] LinqDefaults => EMPTY;
23+
protected override String[] VisibilityDefaults => EMPTY;
3124

3225
[ImportingConstructor]
3326
public Css(IVsfSettings settings) : base(settings) {
3427
}
3528

36-
public override IStringScanner NewStringScanner(string text) {
37-
return new CssStringScanner(text);
38-
}
39-
protected override IBraceScanner NewBraceScanner() {
40-
return new CssBraceScanner();
41-
}
29+
public override IStringScanner NewStringScanner(string text)
30+
=> new CssStringScanner(text);
31+
protected override IBraceScanner NewBraceScanner()
32+
=> new CssBraceScanner();
4233
}
4334
}

src/Viasfora.Languages/DefaultLanguage.cs

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,21 @@
77

88
namespace Winterdom.Viasfora.Languages {
99
public class DefaultLanguage : LanguageInfo {
10-
static readonly String[] empty = new String[0];
11-
protected override String[] ControlFlowDefaults {
12-
get { return empty; }
13-
}
14-
protected override String[] LinqDefaults {
15-
get { return empty; }
16-
}
17-
protected override String[] VisibilityDefaults {
18-
get { return empty; }
19-
}
10+
protected override String[] ControlFlowDefaults => EMPTY;
11+
protected override String[] LinqDefaults => EMPTY;
12+
protected override String[] VisibilityDefaults => EMPTY;
2013

21-
protected override string[] SupportedContentTypes {
22-
get { return empty; }
23-
}
24-
public override string KeyName {
25-
get { return "Text"; }
26-
}
14+
protected override string[] SupportedContentTypes => EMPTY;
15+
public override string KeyName => "Text";
2716

2817
[ImportingConstructor]
2918
public DefaultLanguage(IVsfSettings settings) : base(settings) {
3019
}
3120

32-
3321
public override bool MatchesContentType(IContentType contentType) {
3422
return true;
3523
}
36-
protected override IBraceScanner NewBraceScanner() {
37-
return new DefaultBraceScanner();
38-
}
39-
40-
private class NoFirstLineCommentParser : IFirstLineCommentParser {
41-
public string Parse(ITextChars tc) {
42-
return "";
43-
}
44-
}
24+
protected override IBraceScanner NewBraceScanner()
25+
=> new DefaultBraceScanner();
4526
}
4627
}

src/Viasfora.Languages/FSharp.cs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,20 @@ public class FSharp : LanguageInfo {
2121
static readonly String[] VIS_KEYWORDS = {
2222
"public", "private", "internal"
2323
};
24-
protected override String[] ControlFlowDefaults {
25-
get { return KEYWORDS; }
26-
}
27-
protected override String[] LinqDefaults {
28-
get { return LINQ_KEYWORDS; }
29-
}
30-
protected override String[] VisibilityDefaults {
31-
get { return VIS_KEYWORDS; }
32-
}
33-
public override String KeyName {
34-
get { return Constants.FSharp; }
35-
}
36-
protected override String[] SupportedContentTypes {
37-
get { return new String[] { ContentType }; }
38-
}
24+
protected override String[] ControlFlowDefaults => KEYWORDS;
25+
protected override String[] LinqDefaults => LINQ_KEYWORDS;
26+
protected override String[] VisibilityDefaults => VIS_KEYWORDS;
27+
public override String KeyName => Constants.FSharp;
28+
protected override String[] SupportedContentTypes
29+
=> new String[] { ContentType };
3930

4031
[ImportingConstructor]
4132
public FSharp(IVsfSettings settings) : base(settings) {
4233
}
4334

44-
protected override IBraceScanner NewBraceScanner() {
45-
return new FSharpBraceScanner();
46-
}
47-
public override IStringScanner NewStringScanner(String text) {
48-
return new FSharpStringScanner(text);
49-
}
35+
protected override IBraceScanner NewBraceScanner()
36+
=> new FSharpBraceScanner();
37+
public override IStringScanner NewStringScanner(String text)
38+
=> new FSharpStringScanner(text);
5039
}
5140
}

0 commit comments

Comments
 (0)