How to show message from custom function w/o using task pane or return value? - excel-addins

Is it possible to show a message (just a warning the user can dismiss) from code in a custom function without using a task pane? (And without making it the return value of the function.) Something that shows up in the status bar, or a popup, etc.?
And obviously, if so, how do you do it?
(Office.context.ui.displayDialogAsync isn't available from the custom functions context, not even in the shared runtime.)

Thank you for reaching us. So far we don't support it. I'd recommend going to Microsoft 365 Developer Platform Ideas Forum and see if this feature has already been requested or if request a new feature. Thanks for your support!

Related

How to check if the text in an editor has focus when developing an extension?

Same to editorTextFocus, but I want to check this condition when developing an extension, what's the API for that?
I've tried the following:
if (window.activeTextEditor) {
// ...
}
But the result is not the same as using editorTextFocus.
So I've wanted something like a getContext API which is the corollary to setContext API, in this case, I would use it like getContext('editorTextFocus').
After a lot of searchings, I ended up in this Add getContext command PR, but it got rejected due to these reasons, basically saying getContext API is not the solution for this type of issues. I guess we'll have to wait until the VSCode team come up with a better API for this, let's hope it won't take too long.

point-of-sale-api iOS callback from FileMaker Go

I'm close to getting my homegrown POS app to work with Square, but I'm missing something simple and can't seem to turn up an answer. I'm using FileMaker Go as the app, but I don't think that that is relevant to my current proof-of-concept issue. It may be relevant to other issues later (callbacks).
In my point-of-sale-api settings, I have:
com.filemaker.go.17
for the Bundle ID, and
create-workflow
for the iOS App URL Schemes, which seems to be the first piece of code that Square allows me to save. Any prefixed item such as shortcuts://create-workflow gives an error without description (I'm hoping that Square will trigger a workflow as a test in this POC).
I'm hoping to just trigger safari or workflow/shortcuts with the callback as filemaker go doesn't directly accept the callback response without a helper application - which I'll eventually try.
Any thoughts on what I'm missing?
Thanks tons!

Automatic handling of errors/warnings

On a linking error, I can raise appropriate diagnostic (say MyDSL.MY_APPROPRIATE_DIAGNOSTIC) and then write, in MyDSLQuickfixProvider, a quick fix for it by annotating it in this way:
#Fix(MyDSL.MY_APPROPRIATE_DIAGNOSTIC)
public void fixMyAppropriateDiagnostic(final Issue issue, final IssueResolutionAcceptor acceptor) {
...
}
What about if I wanted to automatically resolve a diagnostic, i.e. automatically execute an IModification without propose it to the user as quick fix (imagine the quick fix for the diagnostic is unique)?
Is there a way to associate a (immediate) handling code to a diagnostic in a similar manner to what happens for (user-proposed) quick fixes?
Thanks in advance,
Marco
There is no way to set a quick fix to be executed automatically. Your alternatives are:
Invoke the marker resolution code from somewhere else in your code. I.e. while marker resolutions are typically triggered explicitly on user request using the problems view, ruler buttons and similar UI, you could invoke them from anywhere. Be sure that you don't interfere with quickfixes, which are not from your plugin and make sure your users are not surprised by this non-eclipse workflow.
For some issues you may be able to instead create code completion rules or templates. Those are still not fully automatic as requested, but basically you can already "correct" partial user input that way and avoid flagging a violation for the complete input.

MVVM Light : How to remove dependency of System.Windows.MessageBoxResult from DialogMessage

I'm working on a MVVM application, using MVVM Light and on the whole I'm finding it very nice to work with. I have a nagging issue however and hope someone can help.
I'm using sending instances of DialogMessage from VM to the View to display dialogs. The result is sent back to my VM via a callback, all good so far.
However the result of the dialog (OK, Yes, No, Cancel etc) is sent back as a member of the enum System.Windows.MessageBoxResult. This seems to go against the View/ViewModel separation to me, MessageBoxResult is clearly a type from the UI and so the VM shouldn't be dependent upon this or anything from the System.Windows namespace.
What I'm looking for is someway of using DialogMessage with an alternative callback eg Action<UserResult>; rather than Action<System.Windows.MessageBoxResult>;, where UserResult is a type defined by me to represent the users choice without dependency on MessageBoxResult.
Is this possible or am I being too strict in me desire to keep UI concepts out of the VM?
In regards to the second part of your question, when I started working with MVVM Light I too felt that receiving a MessageBoxResult back in the VM seems a little to UI-oriented.
On the other hand, if only the name was different - such as UserResult as you suggested - would that be sufficient for you?
If only the nameing of the class is a problem, I think you can let it slip. The result Ok, Yes, No, Cancel do not give an indication of whether a MessageBox was shown with buttons or whether it was some other kind of UI implementation (lets say a form with a combo box).
If it still bothers you, you can always create a wrapper for the DialogMessage which will raise the Dialog, get the MessageBoxResult and return a UserResult which can be an enum with the same values (think of it as a simple converter).
But as I said, I think it might be an overkill...

Eclipse builder: How does it work?

Does anyone know any details on the underlying eclipse builder that sends jobs to the compiler and get its report? and how to tap to it? The level of abstraction that the builder extension offers is too high and the information insufficient. So I implemented an IResourceChangeListener and played with the ResourceDelta in order to get the messages from an IMarker. It works perfectly, however I realized the message is just returning a string. So my question is, how do I do in order to get the type/reference of the object where the error is, what type of error, what class it should belongs to and all available info.
Thanks.
Have you looked at the builder documentation?
And there is also This article by John.
I think between those two and looking at the code you will find everything you need to know.