Skip to content
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

Remove type provider security dialog and use custom icon for type provider assembly reference #448

Conversation

enricosada
Copy link
Contributor

ref #378

  • new icon ( @KevinRansom )
  • update icon
  • remove security dialog
  • remove tools options page
  • cleanup unused code

I was hasty about icon design, sry.

This is a pr to enable a custom icon based of assembly type (normal or type provider), but the custom icon will come from the VS branding team.

by @KevinRansom (see below)

Just to set expectations.
Whilst I think it's interesting to scout ideas, and to produce prototypes, Icons are part of branding and VS branding is not owned by the feature team (us), so the outcome of this effort will likely serve as input to what the VS branding team does.

@enricosada enricosada changed the title [WIPuse custom icon for assembly reference [WIP] use custom icon for type provider assembly reference May 13, 2015
@allykzam
Copy link

Cross-posting from #378, my 2¢ is to somehow base the icon off of the F# logos. My initial preference would be to just globally use the blue logo, but it might look better to use the blue logo with Visual Studio's light and blue themes, but to use one of the dark logos with the dark theme.

All three for comparison (the empty space below is the light logo, and is basically white; preview it over something dark):

blue logo

light logo

dark logo

@forki
Copy link
Contributor

forki commented May 13, 2015

@ReedCopsey as an official fsharp.org spokesperson, can you please comment on possible license issues?

@enricosada
Copy link
Contributor Author

16x16 is really small, with fsharp logo ( resized from http://fsharp.org/favicon.ico ) is like
image

and i dont see dark/light themed icons in current codebase, maybe is easier to start with only one

image

ihmo the fsharp logo is not the best solution, the logo = fsharp language, not a type provider.
maybe is more meaningful for other stuff

@enricosada
Copy link
Contributor Author

added the placeholder, download e53ce24 to design and test the icon inside visualstudio

the placeholder is last spot in imagelist, and the icon is applied to all assemblies, so any project is ok

@KevinRansom
Copy link
Member

Just to set expectations.

Whilst I think it's interesting to scout ideas, and to produce prototypes, Icons are part of branding and VS branding is not owned by the feature team (us), so the outcome of this effort will likely serve as input to what the VS branding team does.

Thanks

Kevin

@latkin
Copy link
Contributor

latkin commented May 13, 2015

+1 to @KevinRansom, we can't just come up with an icon of our choosing. Lots of legal, globalization, and marketing factors to consider. It needs to come from our dedicated art/branding people, or at least re-use an already-approved icon used elsewhere in VS.

@forki
Copy link
Contributor

forki commented May 13, 2015

Since we all want to get it in asap we should consider to just change the color of the existing icon in order to formally fulfill the requirement of different icon. The beautification process can be done separately.

@enricosada enricosada force-pushed the new_shiny_icon_for_type_provider_assembly_reference branch from e53ce24 to 678b2a3 Compare May 15, 2015 17:09
@enricosada
Copy link
Contributor Author

waah, these commit are for master branch not fsharp4 😢 i'll fix this tomorrow

Now the assembly reference icon is changed ( using old logic ) only after a build.
I'll enable the other old path for dialog, and use that too for change icon (so icon change after add reference)

I removed pretty much all code/resources, splitted in multiple commit for easier diff

i tried to remove the type providers option page ( Options -> Tools -> Visual F# -> Type Providers ), removing

  • the type TypeProviderToolsOptionsPage
  • the ProvideOptionPage vsintegration/src/vs/FsPkgs/FSharp.Project/FS/Project.fs

but no luck, the menu is always there, only contains an error message about page creation.
So now there is the menu, but the page is empty. Can you remove it or we need to add a message?

@enricosada
Copy link
Contributor Author

removed all unused code, updated comment and cleanup.

tools option page

i removed the tools options page code but the page continue to exists because the VF# extension ( not the EnableOpenSource extension ) add the registry entry HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0FSharp_Config\ToolsOptionsPages\F# Tools\Type Providers .
I think a new build of vf# extension fix this problem /cc @KevinRansom

update assembly icon strategy

now the icon is updated after a build, but not if the project is already up-to-date (for example after reopening of a solution). a new build update the icon, so np.
This remove the global displyDialog, recenteFile global and clean the code alot.

maybe we can remove the old flow or improve it. The flow is:

  1. use fsc code to compile
  2. use a function to publish type provider assemblies path
  3. exit after assemblies are imported, before typecheck

but i need an hint /cc @dsyme @latkin @KevinRansom

@latkin latkin changed the title use custom icon for type provider assembly reference Remove type provider security dialog and use custom icon for type provider assembly reference Aug 4, 2015
@latkin latkin removed the V.Next label Aug 4, 2015
@latkin latkin added this to the F# 4.0 Update 1 milestone Aug 4, 2015
@latkin
Copy link
Contributor

latkin commented Aug 17, 2015

I'm working on getting this merged. It will be nice to say goodbye to the TP security dialog 👋

@latkin
Copy link
Contributor

latkin commented Aug 19, 2015

Worked through this today and came to the following:

  • Changes in this PR do a fine job of removing the TP dialog, that part is ok
  • It's simple to remove the options menu page for TP approvals with a small setup change (remove a reg key)
  • It's not entirely easy to retrofit the old "pop a dialog" codepaths to now mark a reference node as containing a type provider
    • TPs can be reliably checked at the point of launching a full build. That part is implemented in this PR.
    • But what I would expect as a user, and what's not in this PR, is for the reference node to be marked properly at design-time, right when I add the reference. Making this work reliably is a bit hard*. Without this bit, you have to wait until you do a full build before references are updated.

So I propose we scope this PR down to simply "removing the dialog," ignoring the "mark a reference node as containing TPs" feature for now. That's low-risk and achieves the primary goal of ditching the dialog.

I'll see what I can do to make the marking feature more robust, and open a separate PR for that.

* When the language service compiler encounters a type provider, the current mechanism for tying that back to a particular VS project is GlobalsTheLanguageServiceCanPoke.theMostRecentFileNameWeChecked. It's assumed that whatever project contains the last-processed file must also contain the just-encountered TP reference. From some quick testing, this is actually not a safe assumption - I found that the last-processed file was sometimes in a totally different project. When we were just popping a dialog, it didn't really matter if this was inaccurate, but now it does.

@latkin
Copy link
Contributor

latkin commented Aug 19, 2015

If ProcessCommandLineArgsAndImportAssemblies is cheap, then we could make the feature work reliably by simply removing the if actuallyBuild then condition here.

Right now, adding a reference triggers the Compile method, but actuallyBuild is false so we don't get full references computation.

@latkin latkin closed this in 0f514ef Aug 19, 2015
@latkin latkin added the fixed label Aug 19, 2015
@enricosada
Copy link
Contributor Author

thx @latkin! i think the old code should be axed completly, is a global hack, and need lot of work for know in what projects the assembly is.
Is better to have a new clean method on the compiler service, to ask if an assembly is a type provider and maybe return the name of the type providers contained in the assembly (to add child nodes on the reference to easier discover type providers?). A new issue anyway

@@ -444,7 +444,6 @@ let testFlag tcConfigB =
// not shown in fsc.exe help, no warning on use, motiviation is for use from VS
let vsSpecificFlags (tcConfigB: TcConfigBuilder) =
[ CompilerOption("vserrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.VSErrors), None, None);
CompilerOption("validate-type-providers", tagNone, OptionUnit (fun () -> tcConfigB.validateTypeProviders <- true), None, None);
Copy link
Contributor

Choose a reason for hiding this comment

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

I do wonder if this flag should be left in and ignored.

In theory the next version of the Visual F# fsc.exe compiler will only be used with the corresponding Visual F# Tools and FSharp.Build.dll. But perhaps somehow the compiler will be invoked via the old tools, or an open source version of the tools, or some other tool that has copied out the command-line settings from the Visual F# Tools invocations of fsc.exe (which includes this flag). Perhaps just ignoring the option would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 set as deprecated and noop. Because is a minor version (oob), no breaking changes
so if someone use it, get the warning but no error (build failed)
Next version (master?), cleanup and remove all deprecated commands?
I can do it, /cc @latkin

Copy link
Contributor

Choose a reason for hiding this comment

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

@dsyme yes I thought about that a bit, but dismissed it as it would need to be some kind of unsupported IDE setup... but I agree it's cheap and simple to keep it with a no-op so that we never have to worry. Anyone is welcome to send that in a PR.

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.

8 participants