-
-
Notifications
You must be signed in to change notification settings - Fork 385
code reformat #915
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
Merged
Merged
code reformat #915
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
53b4c03
提交代码格式化
CppCXY bfe1151
更新依赖版本
CppCXY b5ad43e
悄悄给苹果升个级
CppCXY a437c70
mac版本修改回去,更新依赖
CppCXY 1cb3007
更新依赖
CppCXY feed6fc
更新依赖
CppCXY 8e41ce1
更新依赖
CppCXY 5888272
提供范围格式化
CppCXY e1faccf
提供范围格式化
CppCXY c875b7a
修复错误
CppCXY 53d65c5
修复错误
CppCXY 4a1314d
不改type-formatting了
CppCXY 6b2dbe2
修改命名
CppCXY e590411
修改命名
CppCXY 5efd35c
支持namedef和attribute保持一个间距的配置
CppCXY c8d9a89
修改代码风格
CppCXY 38adf62
提供代码风格诊断
CppCXY 3f620ce
更新到现在最新版
CppCXY 4a2203d
Merge branch 'format' of https://github.com/CppCXY/lua-language-serve…
CppCXY 96bdc53
更新到最新版
CppCXY File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule EmmyLuaCodeStyle
added at
0d0629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| local lm = require 'luamake' | ||
|
|
||
| lm:source_set 'code_format' { | ||
| rootdir = '../3rd/EmmyLuaCodeStyle', | ||
| includes = { | ||
| "include", | ||
| "../bee.lua/3rd/lua" | ||
| }, | ||
| sources = { | ||
| -- codeFormatLib | ||
| "CodeFormatLib/src/*.cpp", | ||
| -- LuaParser | ||
| "LuaParser/src/*.cpp", | ||
| "LuaParser/src/LuaAstNode/LuaAstNode.cpp", | ||
| -- Util | ||
| "Util/src/StringUtil.cpp", | ||
| "Util/src/Utf8.cpp", | ||
| --CodeService | ||
| "CodeService/src/*.cpp", | ||
| "CodeService/src/FormatElement/*.cpp", | ||
| "CodeService/src/NameStyle/*.cpp" | ||
| }, | ||
| macos = { | ||
| -- macosx10.12不支持完整的std filesystem,只好砍功能 | ||
| defines = "NOT_SURPPORT_FILE_SYSTEM", | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| local code_format = require "code_format" | ||
| local files = require("files") | ||
| local log = require("log") | ||
|
|
||
| return function(uri) | ||
| local text = files.getText(uri) | ||
| local ast = files.getState(uri) | ||
| local status, formattedText = code_format.format(uri, text) | ||
|
|
||
| if not status then | ||
| if formattedText ~= nil then | ||
| log.error(formattedText) | ||
| end | ||
|
|
||
| return | ||
| end | ||
|
|
||
| return { | ||
| { | ||
| start = ast.ast.start, | ||
| finish = ast.ast.finish, | ||
| text = formattedText, | ||
| } | ||
| } | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| local code_format = require "code_format" | ||
| local files = require("files") | ||
| local log = require("log") | ||
| local converter = require("proto.converter") | ||
|
|
||
| return function(uri, range) | ||
| local text = files.getText(uri) | ||
| local status, formattedText, startLine, endLine = code_format.range_format( | ||
| uri, text, range.start.line, range["end"].line) | ||
|
|
||
| if not status then | ||
| if formattedText ~= nil then | ||
| log.error(formattedText) | ||
| end | ||
|
|
||
| return | ||
| end | ||
|
|
||
| return { | ||
| { | ||
| start = converter.unpackPosition(uri, { line = startLine, character = 0 }), | ||
| finish = converter.unpackPosition(uri, { line = endLine + 1, character = 0 }), | ||
| text = formattedText, | ||
| } | ||
| } | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.