Skip to content

Commit

Permalink
goto-type-at-point: Create if resolved to be same package.
Browse files Browse the repository at this point in the history
[#6]
  • Loading branch information
espenhw committed Mar 23, 2009
1 parent 3ee6e2c commit 6ae32cf
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions src/main/lisp/malabar-mode.el
Expand Up @@ -129,14 +129,31 @@ present."
(let* ((project-file (malabar-find-project-file buffer))
(qualified-type (or (malabar-qualify-class-name-in-buffer type buffer)
type))
(file (locate-file
(malabar-class-name-to-filename qualified-type)
(append (malabar-project-source-directories project-file)
(malabar-project-test-source-directories project-file)))))
(if file
(find-file file)
;; disassemble?
(error "Cannot find type %s" qualified-type))))))
(type-file (malabar-class-name-to-filename qualified-type))
(existing-file
(locate-file
type-file
(append (malabar-project-source-directories project-file)
(malabar-project-test-source-directories project-file)))))
(cond (existing-file
(find-file existing-file))
((equal (malabar-get-package-of qualified-type)
(malabar-get-package-name buffer))
(find-file
(expand-file-name
type-file
(car
(case (intern (malabar-choose "Create type in which tree: "
'("main" "test")
"main"))
(main
(malabar-project-source-directories project-file))
(test
(malabar-project-test-source-directories project-file))))))
(malabar-update-package))
(t
;; disassemble?
(error "Cannot find type %s" qualified-type)))))))

(define-mode-local-override semantic-get-local-variables
malabar-mode ()
Expand Down

0 comments on commit 6ae32cf

Please sign in to comment.