Skip to content

Commit 9c51d20

Browse files
committed
pcall code_format
1 parent c78478e commit 9c51d20

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

main.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ log.info('LOGPATH:', LOGPATH)
6868
log.info('METAPATH:', METAPATH)
6969
log.info('VERSION:', version.getVersion())
7070

71+
local stdRequire = require
72+
require = function (name)
73+
if name == 'code_format' then
74+
error('cannot found code_format')
75+
end
76+
return stdRequire(name)
77+
end
78+
7179
require 'tracy'
7280
require 'cli'
7381

script/provider/formatting.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
local codeFormat = require 'code_format'
1+
local suc, codeFormat = pcall(require, 'code_format')
2+
if not suc then
3+
return
4+
end
5+
26
local ws = require 'workspace'
37
local furi = require 'file-uri'
48
local fs = require 'bee.filesystem'

0 commit comments

Comments
 (0)