Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Feb 18, 2021
1 parent ca9b822 commit b17c2b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions range.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ package protocol
type Range struct {
Vertex
RangeData
Tag *RangeDeclarationTag `json:"tag,omitempty"`
Tag *RangeTag `json:"tag,omitempty"`
}

type RangeData struct {
Start Pos `json:"start"`
End Pos `json:"end"`
}

// Formerly known as RangeSymbolTag
// TODO: rename RangeTag
type RangeDeclarationTag struct {
type RangeTag struct {
Type string `json:"type"`
FullRange *RangeData `json:"fullRange,omitempty"`
SymbolData
Expand All @@ -24,7 +22,7 @@ type Pos struct {
Character int `json:"character"`
}

func NewRange(id uint64, start, end Pos, tag *RangeDeclarationTag) Range {
func NewRange(id uint64, start, end Pos, tag *RangeTag) Range {
return Range{
Vertex: Vertex{
Element: Element{
Expand Down
2 changes: 1 addition & 1 deletion reader/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type MetaData struct {

type Range struct {
protocol.RangeData
Tag *protocol.RangeDeclarationTag `json:"tag,omitempty"`
Tag *protocol.RangeTag `json:"tag,omitempty"`
}

type ResultSet struct{}
Expand Down
4 changes: 2 additions & 2 deletions writer/emitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ func (e *Emitter) EmitDocument(languageID, path string) uint64 {
return id
}

func (e *Emitter) EmitRange(start, end protocol.Pos, tag *protocol.RangeDeclarationTag) uint64 {
func (e *Emitter) EmitRange(start, end protocol.Pos, tag *protocol.RangeTag) uint64 {
id := e.nextID()
e.writer.Write(protocol.NewRange(id, start, end, tag))
return id
}

// EmitRangeWithTag emits a range with a "tag" property describing a symbol.
func (e *Emitter) EmitRangeWithTag(start, end protocol.Pos, tag *protocol.RangeDeclarationTag) uint64 {
func (e *Emitter) EmitRangeWithTag(start, end protocol.Pos, tag *protocol.RangeTag) uint64 {
id := e.nextID()
e.writer.Write(protocol.NewRange(id, start, end, tag))
return id
Expand Down

0 comments on commit b17c2b1

Please sign in to comment.