oleg-shilo / cs-script.npp

CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
MIT License
248 stars 52 forks source link

Format Document not using tab size of 3 #41

Open anthonynorthrup314 opened 5 years ago

anthonynorthrup314 commented 5 years ago

Issue:

When formatting my C# file, it does not appear to properly get the indentation level I configured. It properly uses spaces instead of tabs, however it puts 4 spaces when all languages have 3 specified.

System information:

Reproduction steps: https://www.screencast.com/t/2MnRTThoRigJ

using System;

namespace Foo
{
class Bar
{
public static void main(String[] args)
{
Console.WriteLine("Press Enter to continue...");
Console.ReadLine();
}
}
}
oleg-shilo commented 5 years ago

Hi Antony,

This is a tricky issue to solve.The problem is that C# formatting is done by the external component based on Roslyn C# syntax engine, which has nothing to do with N++. Thus the there is no way for the formatter to discover the current N++ setting. Thus the formatting is done according default Roslyn settings that reflect styling preferences commonly accepted in C# community. Which are... "4 spaces instead of tabs".

Nevertheless it is a valid feature request and I will try to integrate Roslyn settings with N++ ones.

oleg-shilo commented 5 years ago

Hi Antony,

This is a tricky issue to solve.The problem is that C# formatting is done by the external component based on Roslyn C# syntax engine, which has nothing to do with N++. Thus the there is no way for the formatter to discover the current N++ setting. Thus the formatting is done according default Roslyn settings that reflect styling preferences commonly accepted in C# community. Which are... "4 spaces instead of tabs".

Nevertheless it is a valid feature request and I will try to integrate Roslyn settings with N++ ones.