Skip to content

Commit

Permalink
Forward the filetype from the client
Browse files Browse the repository at this point in the history
  • Loading branch information
creativecreature committed Jul 18, 2024
1 parent b2d2ef0 commit 8a97cff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ type Client struct {
// createEvents creates a new event from the slice of arguments
// that we receive from the neovim client.
func createEvent(args []string) pulse.Event {
filetype := args[2]
if filetype == "typescript.tsx" {
filetype = "typescript"
}

return pulse.Event{
EditorID: args[0],
Path: args[1],
Filetype: filetype,
Editor: "nvim",
OS: runtime.GOOS,
}
Expand Down
6 changes: 6 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ func (s *Server) openFile(event pulse.Event) {
return
}

s.logger.Debug("Successfully parsed the git file",
"name", gitFile.Name,
"filetype", gitFile.Filetype,
"repository", gitFile.Repository,
)

if s.activeBuffer != nil {
if s.activeBuffer.Filepath == gitFile.Path && s.activeBuffer.Repository == gitFile.Repository {
s.logger.Debug("This buffer is already considered active",
Expand Down

0 comments on commit 8a97cff

Please sign in to comment.