Skip to content

Invoke hasktags more directly #1204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 21, 2016
Merged

Invoke hasktags more directly #1204

merged 13 commits into from
Mar 21, 2016

Conversation

geraldus
Copy link
Contributor

(ignore-errors (when (and (boundp 'haskell-session) haskell-session)
(haskell-process-generate-tags))))
(ignore-errors
(if (and (boundp 'haskell-session)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need for both functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can rewrite jump-to-tag also.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jump to tag generates tags? That is surprising.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this was my not idea :D
But I think it's not so bad at the end, otherwise user have to generate tags manually. Do you think we should remove tags generation from jump-to-tag? (I suppose there are more surprising things awaiting :D)

@geraldus
Copy link
Contributor Author

But we can rewrite jump-to-tag also.

Ok, I'll do that now

@geraldus
Copy link
Contributor Author

@gracjan done

@gracjan
Copy link
Contributor

gracjan commented Mar 14, 2016

Looks great!

I wonder if we could have a testing framework for all these external programs that we invoke here and there. We could have some integration tests in .travis.yml, a category of tests that is completely absent from our test suite right now.

There are a couple of ways around that issue:

  1. Use el-mock and stop right before the external program is executed.
  2. Create substitute programs as shell scripts, for example hasktags-mock.sh and setup haskell-mode to invoke those.
  3. Install real programs and run those.

I would hate if hasktags suddenly stopped working due to some change that we make in good faith.

@gracjan
Copy link
Contributor

gracjan commented Mar 14, 2016

I've filled in #1206 to track the integration testing stuff.

@geraldus
Copy link
Contributor Author

@gracjan what about this one?

@gracjan
Copy link
Contributor

gracjan commented Mar 17, 2016

I've done code review and code is good. I did not have time to actually run the code though. Is there anybody else beside you @geraldus that has checked if it really works?

@geraldus geraldus self-assigned this Mar 18, 2016
(when buffer-file-name
(file-name-directory buffer-file-name))))

(defun haskell-cabal--compose-hasktags-command (&optional cabal-dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make cabal-dir non-optional, always require this to be a proper directory.

@gracjan
Copy link
Contributor

gracjan commented Mar 21, 2016

@geraldus, after you fix the one thing I found then we can merge this. Rest looks great.

geraldus added 13 commits March 21, 2016 21:28
If session is present then use asynchrounous tags generation function
from interactive package, otherwise use blocking function from static
package.
Traversing directories is potentially very costful action.  This
function helps to re-use found dir in some cases.
Move `haskell-mode-message-line` and `haskell-mode-one-line` to
haskell-mode.el.  This function are not specific to interactive package,
also both have name which nicely fit to haskell-mode.el rather than
haskell-interactive-mode.el.  This movement is required to for static
tags generation function also.
Support optional parameter to jump to indentifier definition after tags
were generated.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 29.809% when pulling 9d17007 on geraldus:g/fix-964 into 64442fc on haskell:master.

@geraldus
Copy link
Contributor Author

🍵 All is green now

gracjan added a commit that referenced this pull request Mar 21, 2016
Invoke hasktags more directly
@gracjan gracjan merged commit be9a877 into haskell:master Mar 21, 2016
@gracjan
Copy link
Contributor

gracjan commented Mar 21, 2016

Nice!

@geraldus geraldus deleted the g/fix-964 branch March 21, 2016 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants