feat: enable diagnostics (#891)
This commit is contained in:
@@ -5,7 +5,7 @@ local Range = {}
|
||||
Range.__index = Range
|
||||
|
||||
---@class avante.RangeSelection: table<string, integer>
|
||||
---@field line number
|
||||
---@field lnum number
|
||||
---@field col number
|
||||
|
||||
---Create a selection range
|
||||
@@ -18,4 +18,17 @@ function Range:new(start, finish)
|
||||
return instance
|
||||
end
|
||||
|
||||
---Check if the line and column are within the range
|
||||
---@param lnum number Line number
|
||||
---@param col number Column number
|
||||
---@return boolean
|
||||
function Range:contains(lnum, col)
|
||||
local start = self.start
|
||||
local finish = self.finish
|
||||
if lnum < start.lnum or lnum > finish.lnum then return false end
|
||||
if lnum == start.lnum and col < start.col then return false end
|
||||
if lnum == finish.lnum and col > finish.col then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
return Range
|
||||
|
||||
Reference in New Issue
Block a user