Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request handlers for document formatting #516

Merged
merged 27 commits into from
Jun 14, 2017
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4c6b4f4
Add stub to handle formatting request
May 30, 2017
ca1f97e
Add handler to format document with default settings
Jun 7, 2017
78ad540
Add formatting related types
Jun 7, 2017
2a83b0f
Remove unused handler from LanguageServer
Jun 7, 2017
44ca6b3
Fix DocumentFormattingParams request type
Jun 7, 2017
0b8e8a2
Add a method to enumerate PSScriptAnalyzer cmdlets
Jun 7, 2017
f09d70c
Execute formatter only if module is present
Jun 7, 2017
3da17ee
Handle null value returned by formatter
Jun 7, 2017
7c3ebf8
Add all formatting types and requests
Jun 7, 2017
2f50051
Convert Range type to class from struct
Jun 7, 2017
d8bf331
Update AnalysisService.Format method
Jun 7, 2017
39d69d4
Add range formatting capability to the server
Jun 7, 2017
d00e2ca
Fix format wrapper method
Jun 7, 2017
c4e8866
Disable server side range formatting
Jun 9, 2017
d799a88
Add CodeFormattingSettings type
Jun 10, 2017
466248e
Make properties of FormattingOptions type public
Jun 10, 2017
fb63ff7
Provide settings for formatting
Jun 10, 2017
9eb1b11
Create an abstract base class for settings
Jun 10, 2017
4c1a861
Create a class to represent editor settings
Jun 10, 2017
404b0ae
Disable server side document formatting capability
Jun 13, 2017
ebb6f03
Capitalize options property in FormattingOptions
Jun 13, 2017
0ebfb5e
Send a range array to Format method
Jun 13, 2017
efd884f
Fix merge conflict in LanguageServer.cs
Jun 13, 2017
2851e80
Remove AbstractSettings base class
Jun 13, 2017
6ac7b0d
Update inline xml documentation
Jun 13, 2017
7fc858b
Remove unused request type and its handler
Jun 13, 2017
d74d369
Fix test failures
Jun 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create an abstract base class for settings
  • Loading branch information
Kapil Borle committed Jun 10, 2017
commit 9eb1b11499e52a48b67b827814b89742834136db
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,33 @@ public void Update(
}
}

public class CodeFormattingSettings
public class AbstractSettings
{
public AbstractSettings()
{

}

public AbstractSettings(AbstractSettings abstractSettings)
{
if (abstractSettings == null)
{
throw new ArgumentNullException(nameof(abstractSettings));
}

foreach (var prop in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
prop.SetValue(this, prop.GetValue(abstractSettings));
}
}
}

public class CodeFormattingSettings : AbstractSettings
{
/// <summary>
/// Default constructor.
/// </summary>
public CodeFormattingSettings()
public CodeFormattingSettings() : base()
{

}
Expand All @@ -107,16 +128,9 @@ public CodeFormattingSettings()
/// </summary>
/// <param name="codeFormattingSettings">An instance of type CodeFormattingSettings.</param>
public CodeFormattingSettings(CodeFormattingSettings codeFormattingSettings)
: base(codeFormattingSettings)
{
if (codeFormattingSettings == null)
{
throw new ArgumentNullException(nameof(codeFormattingSettings));
}

foreach (var prop in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
prop.SetValue(this, prop.GetValue(codeFormattingSettings));
}
}

public bool OpenBraceOnSameLine { get; set; }
Expand Down